feat(revisions): add deleting revisions

This commit is contained in:
Karol Sójko
2022-11-28 12:28:38 +01:00
parent b912e050ea
commit ac8a69f8d4
12 changed files with 164 additions and 7 deletions
@@ -13,6 +13,15 @@ export class MySQLRevisionRepository implements RevisionRepositoryInterface {
private revisionMapper: MapperInterface<Revision, TypeORMRevision>,
) {}
async removeOneByUuid(revisionUuid: Uuid, userUuid: Uuid): Promise<void> {
await this.ormRepository
.createQueryBuilder()
.delete()
.from('revisions')
.where('uuid = :revisionUuid AND user_uuid = :userUuid', { userUuid, revisionUuid })
.execute()
}
async findOneByUuid(revisionUuid: Uuid, userUuid: Uuid): Promise<Revision | null> {
const typeormRevision = await this.ormRepository
.createQueryBuilder()