From 8fb4e1c29e0a4ca35d6720600da0951923d59493 Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 18 Sep 2020 09:30:40 -0400 Subject: [PATCH] fix: showing error on add ssh modal --- src/_components/modals/AddSshKey.vue | 7 +++++++ src/_store/users.module.js | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/_components/modals/AddSshKey.vue b/src/_components/modals/AddSshKey.vue index 587cd91..d092ad4 100644 --- a/src/_components/modals/AddSshKey.vue +++ b/src/_components/modals/AddSshKey.vue @@ -134,6 +134,13 @@ export default { show() { this.$modal.show('add-ssh-key'); + + this.name = ''; + this.sshPublicKey = ''; + this.minExpiration = new Date().toISOString(); + this.expiration = null; + this.timezone = this.detectedTimezone.timeZoneId; + this.submitted = false; }, hide() { this.$modal.hide('add-ssh-key'); diff --git a/src/_store/users.module.js b/src/_store/users.module.js index 442ab56..64307a5 100644 --- a/src/_store/users.module.js +++ b/src/_store/users.module.js @@ -144,8 +144,14 @@ const actions = { commit('addSshKeyByUserIdRequest'); return userService.addSshKeyByUserId(userId, sshKey, messages, errors) .then( - key => commit('addSshKeyByUserIdSuccess', key), - error => commit('addSshKeyByUserIdFailure', error) + key => { + commit('addSshKeyByUserIdSuccess', key); + return Promise.resolve(); + }, + error => { + commit('addSshKeyByUserIdFailure', error); + return Promise.reject(); + } ); },