diff --git a/app/src/domain/repository/image-repository.ts b/app/src/domain/repository/image-repository.ts new file mode 100644 index 0000000..6910d74 --- /dev/null +++ b/app/src/domain/repository/image-repository.ts @@ -0,0 +1,12 @@ +import { type Repository } from '@slovo/domain/repository'; +import { Entity, type EntityId } from '@slovo/domain/entity'; +import { Image } from '@slovo/models/image'; +import connectionPool from '@slovo/infrastructure/connection-pool'; + +export class ImageRepository implements Repository { + public async get(id: EntityId): Promise> { + const conn = await connectionPool.getConnection(); + + await conn.release(); + } +} diff --git a/app/src/domain/repository/user-repository.ts b/app/src/domain/repository/user-repository.ts index 9bb9f81..d313070 100644 --- a/app/src/domain/repository/user-repository.ts +++ b/app/src/domain/repository/user-repository.ts @@ -52,7 +52,12 @@ export class UserRepository implements Repository { user.getId() ]); + if (!results.length) { + throw Error("Unable to update the User"); + } + await conn.release(); + return user; } public async delete(user: Entity): Promise {