fix: 🐛 Add missing mirage config urls for credentials (#1209)
This commit is contained in:
1 parent
27a676774c
commit
ae0ce2bfad
4 files changed
+17
-11
No files matched your search
@@ -592,7 +592,20 @@ export default function () {
|
||||
|
||||
// credentials
|
||||
|
||||
this.get(
|
||||
'/credentials',
|
||||
(
|
||||
{ credentials },
|
||||
{ queryParams: { credential_store_id: credentialStoreId } }
|
||||
) => credentials.where({ credentialStoreId })
|
||||
);
|
||||
this.get('/credentials/:id');
|
||||
this.post('/credentials', function ({ credentialStores, credentials }) {
|
||||
const attrs = this.normalizedRequestAttrs();
|
||||
const credentialStore = credentialStores.find(attrs.credentialStoreId);
|
||||
attrs.scopeId = credentialStore.scope.id;
|
||||
return credentials.create(attrs);
|
||||
});
|
||||
|
||||
// managed-groups
|
||||
this.get(
|
||||
|
||||
@@ -10,9 +10,9 @@ export default ApplicationSerializer.extend({
|
||||
);
|
||||
json.credential_store_id = model.credentialStoreId;
|
||||
|
||||
// in a real API, the following field is set-only and returned
|
||||
// as an associated HMAC field
|
||||
delete json.attributes?.password_hmac;
|
||||
// in a real API, the password field is not returned
|
||||
// so we delete it from the response
|
||||
delete json.attributes?.password;
|
||||
|
||||
return json;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user