Start the Image repository.
This commit is contained in:
parent
b031d83a7d
commit
82e1512ccb
12
app/src/domain/repository/image-repository.ts
Normal file
12
app/src/domain/repository/image-repository.ts
Normal file
@ -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<Image> {
|
||||
public async get(id: EntityId): Promise<Entity<Image>> {
|
||||
const conn = await connectionPool.getConnection();
|
||||
|
||||
await conn.release();
|
||||
}
|
||||
}
|
@ -52,7 +52,12 @@ export class UserRepository implements Repository<User> {
|
||||
user.getId()
|
||||
]);
|
||||
|
||||
if (!results.length) {
|
||||
throw Error("Unable to update the User");
|
||||
}
|
||||
|
||||
await conn.release();
|
||||
return user;
|
||||
}
|
||||
|
||||
public async delete(user: Entity<User>): Promise<boolean> {
|
||||
|
Loading…
Reference in New Issue
Block a user