chore: 🤖 cleanup json creds code / tests (#1535)
This commit is contained in:
1 parent
f1b7a9cd84
commit
51c1aba794
10 files changed
+117
-81
No files matched your search
@@ -18,6 +18,14 @@ export default class CredentialModel extends GeneratedCredentialModel {
|
||||
return this.id.startsWith('cred');
|
||||
}
|
||||
|
||||
/**
|
||||
* True if type is `json`.
|
||||
* @type {boolean}
|
||||
*/
|
||||
get isJSON() {
|
||||
return this.type === 'json';
|
||||
}
|
||||
|
||||
/**
|
||||
* True if credential is an unknown type.
|
||||
* @type {boolean}
|
||||
|
||||
@@ -20,7 +20,9 @@ export default class CredentialSerializer extends ApplicationSerializer {
|
||||
delete serialized.attributes.username;
|
||||
|
||||
if (serialized?.attributes?.json_object) {
|
||||
serialized.attributes.object = JSON.parse(serialized.attributes.json_object);
|
||||
serialized.attributes.object = JSON.parse(
|
||||
serialized.attributes.json_object
|
||||
);
|
||||
delete serialized.attributes.json_object;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user