From 8a7682e49960ab14c58f8363f1afd88dae3cb843 Mon Sep 17 00:00:00 2001 From: Andrew Nikitin Date: Tue, 16 Jan 2024 18:46:34 +0100 Subject: [PATCH] fix: Fix for update did [DEV-3494] (#472) Fix for update did --- src/controllers/did.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/controllers/did.ts b/src/controllers/did.ts index 3305922c..c26e2695 100644 --- a/src/controllers/did.ts +++ b/src/controllers/did.ts @@ -315,12 +315,15 @@ export class DIDController { // handle request params const { did, service, verificationMethod, authentication } = request.body as UpdateDidRequestBody; // Get the didDocument from the request if it's placed there - let updatedDocument: DIDDocument | undefined = request.body.didDocument; + let updatedDocument: DIDDocument // Get strategy e.g. postgres or local const identityServiceStrategySetup = new IdentityServiceStrategySetup(response.locals.customer.customerId); try { - if (!updatedDocument && did && (service || verificationMethod || authentication)) { + if (request.body.didDocument) { + // Just pass the didDocument from the user as is + updatedDocument = request.body.didDocument; + } else if (did && (service || verificationMethod || authentication)) { // Resolve DID const resolvedResult = await identityServiceStrategySetup.agent.resolveDid(did); // Check output that DID is not deactivated or exist