From 47d71ea827ab8141428950c3cfe898ae27da9b7e Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Mon, 9 Nov 2020 18:23:26 +0100 Subject: [PATCH] return locked entity on lockEntity and bug --- src/datasources/db/contactinformationAPI.ts | 2 +- src/datasources/db/utils.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/datasources/db/contactinformationAPI.ts b/src/datasources/db/contactinformationAPI.ts index d89f9d6..3cffd2a 100644 --- a/src/datasources/db/contactinformationAPI.ts +++ b/src/datasources/db/contactinformationAPI.ts @@ -78,7 +78,7 @@ export class ContactInformationAPI extends DataSource { .select() .skip(offset) .take(limit) - .execute(); + .getMany(); } async personById (id: number) { diff --git a/src/datasources/db/utils.ts b/src/datasources/db/utils.ts index 88a4f55..272844c 100644 --- a/src/datasources/db/utils.ts +++ b/src/datasources/db/utils.ts @@ -83,11 +83,8 @@ export class LockUtils { }) .where('id = :id', { id: id }) .execute(); - return await this.findById(connection, target, alias, id); - } else { - // lock was set - throw new GraphQLError('Entry locked by other user'); } + return await this.findById(connection, target, alias, id); } static async unlockEntity (connection: Connection, target: ObjectType, alias: string, id: number, userId: number): Promise {