Skip to content

Commit a9ec4ce

Browse files
Ant1 FELIXcat-passwd
Ant1 FELIX
authored andcommitted
Fix API key comments not updating
Set the default value of comment to empty string instead of null. Fixes DependencyTrack#1225
1 parent 6d39df8 commit a9ec4ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/views/administration/accessmanagement/EditApiKeyCommentModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export default {
4343
},
4444
data() {
4545
return {
46-
comment: null,
46+
comment: '',
4747
};
4848
},
4949
mounted() {
@@ -71,7 +71,7 @@ export default {
7171
});
7272
},
7373
resetValues: function () {
74-
this.comment = null;
74+
this.comment = '';
7575
},
7676
},
7777
};

src/views/administration/accessmanagement/Teams.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ export default {
228228
apiKeysToDict: function (apiKeys) {
229229
const dict = {};
230230
apiKeys.forEach((item) => {
231+
item.comment = item.comment ? item.comment : '';
231232
dict[item.publicId] = item;
232233
});
233234
return dict;
@@ -301,6 +302,7 @@ export default {
301302
if (!this.apiKeys) {
302303
this.apiKeys = {};
303304
}
305+
response.data.comment = '';
304306
this.$set(
305307
this.apiKeys,
306308
response.data.publicId,
@@ -324,6 +326,9 @@ export default {
324326
.post(url)
325327
.then((response) => {
326328
this.$delete(this.apiKeys, apiKey.publicId);
329+
response.data.comment = response.data.comment
330+
? response.data.comment
331+
: '';
327332
this.$set(
328333
this.apiKeys,
329334
response.data.publicId,

0 commit comments

Comments
 (0)