deck card count added

This commit is contained in:
magdo
2025-10-20 19:13:50 +02:00
parent 99fa7ebd98
commit aa3587b60a
2 changed files with 10 additions and 1 deletions
@@ -15,6 +15,7 @@ export interface ShortDeckDto {
type: number;
playedNumber: number;
ctype: number;
cardsCount: number;
}
export interface DetailDeckDto {
@@ -9,6 +9,7 @@ export class DeckMapper {
type: deck.type,
playedNumber: deck.playedNumber,
ctype: deck.ctype,
cardsCount: deck.cards.length,
};
}
@@ -26,6 +27,13 @@ export class DeckMapper {
}
static toShortDtoList(decks: DeckAggregate[]): ShortDeckDto[] {
return decks.map(this.toShortDto);
return decks.map(deck => ({
id: deck.id,
name: deck.name,
type: deck.type,
playedNumber: deck.playedNumber,
ctype: deck.ctype,
cardsCount: deck.cards.length,
}));
}
}