Start the Image repository.

This commit is contained in:
Dave Smith-Hayes 2024-04-04 22:20:51 -04:00
parent b031d83a7d
commit 82e1512ccb
2 changed files with 17 additions and 0 deletions

View 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();
}
}

View File

@ -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> {