1 parent
47d7ceccf7
commit
3fc865d226
2 files changed
+17
-3
No files matched your search
@@ -632,7 +632,23 @@ function routes() {
|
||||
{ queryParams: { credential_store_id: credentialStoreId } },
|
||||
) => credentialLibraries.where({ credentialStoreId }),
|
||||
);
|
||||
this.get('/credential-libraries/:id');
|
||||
this.get(
|
||||
'/credential-libraries/:id',
|
||||
function ({ credentialLibraries }, { params: { id } }) {
|
||||
const library = credentialLibraries.find(id);
|
||||
// BE API only updates these fields if there's an update mask, otherwise they remain unmodified
|
||||
// but we don't need this flow in our mocks, so we are deleting fields with null value
|
||||
const { credentialMappingOverrides } = library;
|
||||
if (Object.keys(credentialMappingOverrides || {}).length) {
|
||||
Object.keys(credentialMappingOverrides).forEach((key) => {
|
||||
if (credentialMappingOverrides[key] === null) {
|
||||
delete credentialMappingOverrides[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return library;
|
||||
},
|
||||
);
|
||||
this.post(
|
||||
'/credential-libraries',
|
||||
function ({ credentialStores, credentialLibraries }) {
|
||||
|
||||
Reference in new issue
Block a user