Skip to content

Commit

Permalink
Merge pull request #240 from nscuro/fix-apikey-glitches
Browse files Browse the repository at this point in the history
Fix minor API keys display issues
  • Loading branch information
nscuro authored Sep 4, 2022
2 parents 9ea7384 + e577a6e commit 7181829
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/views/administration/accessmanagement/Teams.vue
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@
createApiKey() {
let url = `${this.$api.BASE_URL}/${this.$api.URL_TEAM}/${this.team.uuid}/key`;
this.axios.put(url).then((response) => {
this.apiKeys.push(response.data);
if (this.apiKeys) {
this.apiKeys.push(response.data);
} else {
this.apiKeys = [response.data];
}
this.$toastr.s(this.$t('message.updated'));
}).catch((error) => {
this.$toastr.w(this.$t('condition.unsuccessful_action'));
Expand Down Expand Up @@ -384,7 +388,11 @@
},
syncVariables: function(team) {
this.team = team;
this.apiKeys = team.apiKeys;
if (team.apiKeys) {
// Some API server responses don't include API keys.
// Take care to not wipe existing API keys from the UI in those cases.
this.apiKeys = team.apiKeys;
}
this.permissions = team.permissions;
//this.ldapGroups = team.mappedLdapGroups;
}
Expand Down

0 comments on commit 7181829

Please sign in to comment.