Skip to content

Commit

Permalink
Update did.js
Browse files Browse the repository at this point in the history
  • Loading branch information
serefyarar committed Feb 13, 2024
1 parent 3525d12 commit 8396254
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions api/src/services/did.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,12 @@ export class DIDService {
throw new Error('Invalid response data');
}

// Return the created profile document
return data.createProfile.document;
const profileObj = data.createProfile.document;

profileObj.id = profileObj.controllerDID.id
delete profileObj.controllerDID;

return profileObj;

} catch (error) {
// Log the error and rethrow it for external handling
Expand Down Expand Up @@ -371,11 +375,13 @@ export class DIDService {
return null
}

data.node.profile.id = data.node.profile.controllerDID.id
delete data.node.profile.controllerDID;
const profileObj = data.node.profile;

profileObj.id = profileObj.controllerDID.id
delete profileObj.controllerDID;

return profileObj;

// Return the created profile document
return data.node.profile;

} catch (error) {
// Log the error and rethrow it for external handling
Expand Down

0 comments on commit 8396254

Please sign in to comment.