Skip to content

Commit

Permalink
Add title to update modal as well
Browse files Browse the repository at this point in the history
  • Loading branch information
moalshak committed Dec 14, 2024
1 parent 7450a93 commit ba352f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions warpgate-admin/src/api/public_key_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ impl DetailApi {
let model = PublicKeyCredential::ActiveModel {
id: Set(id.0),
user_id: Set(*user_id),
openssh_public_key_title: Set(body.openssh_public_key_title.clone()),
..<_>::from(UserPublicKeyCredential::try_from(&*body)?)
}
.update(&*db)
Expand Down
3 changes: 1 addition & 2 deletions warpgate-web/src/admin/CredentialEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@
}
async function savePublicKeyCredential (opensshPublicKeyTitle: string, opensshPublicKey: string) {
// TODO: If it is an existing key, update it
// Otherwise, create a new one
if (editingPublicKeyCredentialInstance) {
editingPublicKeyCredentialInstance.opensshPublicKeyTitle = opensshPublicKeyTitle
editingPublicKeyCredentialInstance.opensshPublicKey = opensshPublicKey
await api.updatePublicKeyCredential({
userId,
Expand Down
2 changes: 1 addition & 1 deletion warpgate-web/src/admin/PublicKeyCredentialModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
Form,
FormGroup,
Input,
Label,
Modal,
ModalBody,
ModalFooter,
Expand Down Expand Up @@ -49,6 +48,7 @@

<Modal toggle={_cancel} isOpen={isOpen} on:open={() => {
if (instance) {
opensshPublicKeyTitle = instance.opensshPublicKeyTitle
opensshPublicKey = instance.opensshPublicKey
}
field?.focus()
Expand Down

0 comments on commit ba352f0

Please sign in to comment.