Skip to content

Commit e577a6e

Browse files
committed
Fix minor API keys display issues
Signed-off-by: nscuro <[email protected]>
1 parent 59829ca commit e577a6e

File tree

1 file changed

+10
-2
lines changed
  • src/views/administration/accessmanagement

1 file changed

+10
-2
lines changed

src/views/administration/accessmanagement/Teams.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,11 @@
225225
createApiKey() {
226226
let url = `${this.$api.BASE_URL}/${this.$api.URL_TEAM}/${this.team.uuid}/key`;
227227
this.axios.put(url).then((response) => {
228-
this.apiKeys.push(response.data);
228+
if (this.apiKeys) {
229+
this.apiKeys.push(response.data);
230+
} else {
231+
this.apiKeys = [response.data];
232+
}
229233
this.$toastr.s(this.$t('message.updated'));
230234
}).catch((error) => {
231235
this.$toastr.w(this.$t('condition.unsuccessful_action'));
@@ -384,7 +388,11 @@
384388
},
385389
syncVariables: function(team) {
386390
this.team = team;
387-
this.apiKeys = team.apiKeys;
391+
if (team.apiKeys) {
392+
// Some API server responses don't include API keys.
393+
// Take care to not wipe existing API keys from the UI in those cases.
394+
this.apiKeys = team.apiKeys;
395+
}
388396
this.permissions = team.permissions;
389397
//this.ldapGroups = team.mappedLdapGroups;
390398
}

0 commit comments

Comments
 (0)