async getOneWithRelations(id: string): Promise<AlbumWithRelationsResponse> {
const { db, withErrorHandling } = this;
return withErrorHandling(async () => {
const { uuid } = uuidSchema.parse({ uuid: id });
const result = await db.query.albumTable.findFirst({
where: eq(albumTable.id, uuid),
with: {
images: true,
},
});
console.log(result);
return result;
});
}
async getOneWithRelations(id: string): Promise<AlbumWithRelationsResponse> {
const { db, withErrorHandling } = this;
return withErrorHandling(async () => {
const { uuid } = uuidSchema.parse({ uuid: id });
const result = await db.query.albumTable.findFirst({
where: eq(albumTable.id, uuid),
with: {
images: true,
},
});
console.log(result);
return result;
});
}