File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/views/administration/accessmanagement Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 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' ));
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 }
You can’t perform that action at this time.
0 commit comments