Skip to content

Commit

Permalink
Accept status boolean value in set status API.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Feb 22, 2024
1 parent 3f53ccd commit 731dc03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@ export async function addRoutes({app, service} = {}) {
try {
const {config} = req.serviceObject;
// FIXME: require `indexAllocator` if not previously set
const {credentialId, credentialStatus} = req.body;
const {credentialId, credentialStatus, status = true} = req.body;

// FIXME: support client requesting `status=false` as well
await setStatus({config, credentialId, credentialStatus, status: true});
await setStatus({config, credentialId, credentialStatus, status});

res.status(200).end();
} catch(error) {
Expand Down
6 changes: 6 additions & 0 deletions schemas/bedrock-vc-status.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export const updateCredentialStatusBody = {
required: ['type', 'statusPurpose'],
additionalProperties: false,
properties: {
id: {
type: 'string'
},
type: {
type: 'string'
},
Expand All @@ -71,6 +74,9 @@ export const updateCredentialStatusBody = {
type: 'string'
}
}
},
status: {
type: 'boolean'
}
}
};

0 comments on commit 731dc03

Please sign in to comment.