Skip to content

Commit

Permalink
Formating
Browse files Browse the repository at this point in the history
Signed-off-by: vikastc <[email protected]>
  • Loading branch information
Vikastc committed Aug 24, 2023
1 parent fdb9a66 commit a902774
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/controller/credential_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ export async function updateCred(req: express.Request, res: express.Response) {
let schemaProp: any = undefined;
let credProp: any = undefined;

const updatedContent = data.property;

if (data.schemaId) {
const schemaId = data.schemaId ? data.schemaId : "";
schemaProp = await getSchema(schemaId);
Expand All @@ -247,13 +249,12 @@ export async function updateCred(req: express.Request, res: express.Response) {
return res.status(400).json({ result: "No Cred found" });
}
}
const keyUri =
`${issuerDid.uri}${issuerDid.authentication[0].id}` as Cord.DidResourceUri;

const schema = JSON.parse(schemaProp.cordSchema);
const document = JSON.parse(credProp.credential);

const updatedContent = data.property;
const schema = JSON.parse(schemaProp.cordSchema);
const keyUri =
`${issuerDid.uri}${issuerDid.authentication[0].id}` as Cord.DidResourceUri;

const updatedDocument: any = await updateStream(
document,
Expand All @@ -280,12 +281,10 @@ export async function updateCred(req: express.Request, res: express.Response) {

await getConnection().manager.save(credProp);

return res
.status(200)
.json({
result: "Updated successufully",
identifier: credProp.identifier,
});
return res.status(200).json({
result: "Updated successufully",
identifier: credProp.identifier,
});
} catch (error) {
console.log("error: ", error);
return res.status(400).json({ err: error });
Expand Down

0 comments on commit a902774

Please sign in to comment.