mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
feat: get card by child id
This commit is contained in:
@ -63,6 +63,15 @@ export class CardService {
|
||||
|
||||
return this.getCardById(createdCard.id);
|
||||
}
|
||||
|
||||
async getCardByChildId(guardianId: string, childId: string): Promise<Card> {
|
||||
const card = await this.cardRepository.findCardByChildId(guardianId, childId);
|
||||
if (!card) {
|
||||
throw new BadRequestException('CARD.NOT_FOUND');
|
||||
}
|
||||
await this.prepareJuniorImages([card]);
|
||||
return card;
|
||||
}
|
||||
async getCardById(id: string): Promise<Card> {
|
||||
const card = await this.cardRepository.getCardById(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user