return locked entity on lockEntity and bug

pull/14/head
leonnicolas 4 years ago
parent 5a52f592cb
commit 47d71ea827
No known key found for this signature in database
GPG Key ID: 088D0743E2B65C07

@ -78,7 +78,7 @@ export class ContactInformationAPI extends DataSource {
.select() .select()
.skip(offset) .skip(offset)
.take(limit) .take(limit)
.execute(); .getMany();
} }
async personById (id: number) { async personById (id: number) {

@ -83,11 +83,8 @@ export class LockUtils {
}) })
.where('id = :id', { id: id }) .where('id = :id', { id: id })
.execute(); .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<Lockable>, alias: string, id: number, userId: number): Promise<boolean> { static async unlockEntity (connection: Connection, target: ObjectType<Lockable>, alias: string, id: number, userId: number): Promise<boolean> {

Loading…
Cancel
Save