diff --git a/packages/data-store/src/data-store.ts b/packages/data-store/src/data-store.ts index 310210eac..28815bc4e 100644 --- a/packages/data-store/src/data-store.ts +++ b/packages/data-store/src/data-store.ts @@ -63,7 +63,7 @@ export class DataStore implements IAgentPlugin { } async dataStoreGetMessage(args: IDataStoreGetMessageArgs): Promise { - const messageEntity = await (await getConnectedDb(this.dbConnection)).getRepository(Message).findOne({ + const [messageEntity] = await (await getConnectedDb(this.dbConnection)).getRepository(Message).find({ where: { id: args.id }, relations: ['credentials', 'presentations'], }) @@ -73,7 +73,7 @@ export class DataStore implements IAgentPlugin { } async dataStoreDeleteMessage(args: IDataStoreDeleteMessageArgs): Promise { - const messageEntity = await (await getConnectedDb(this.dbConnection)).getRepository(Message).findOne({ + const [messageEntity] = await (await getConnectedDb(this.dbConnection)).getRepository(Message).find({ where: { id: args.id }, relations: ['credentials', 'presentations'], }) diff --git a/packages/data-store/src/identifier/did-store.ts b/packages/data-store/src/identifier/did-store.ts index c9f845d57..9de577d21 100644 --- a/packages/data-store/src/identifier/did-store.ts +++ b/packages/data-store/src/identifier/did-store.ts @@ -48,7 +48,7 @@ export class DIDStore extends AbstractDIDStore { throw Error('[veramo:data-store:identifier-store] Get requires did or (alias and provider)') } - const identifier = await (await getConnectedDb(this.dbConnection)).getRepository(Identifier).findOne({ + const [identifier] = await (await getConnectedDb(this.dbConnection)).getRepository(Identifier).find({ where, relations: ['keys', 'services'], }) @@ -88,7 +88,7 @@ export class DIDStore extends AbstractDIDStore { } async deleteDID({ did }: { did: string }) { - const identifier = await (await getConnectedDb(this.dbConnection)).getRepository(Identifier).findOne({ + const [identifier] = await (await getConnectedDb(this.dbConnection)).getRepository(Identifier).find({ where: { did }, relations: ['keys', 'services', 'issuedCredentials', 'issuedPresentations'], })