diff --git a/src/modules/cards/infrastructure/cards.repository.ts b/src/modules/cards/infrastructure/cards.repository.ts index 6f78c14..5bf54c2 100644 --- a/src/modules/cards/infrastructure/cards.repository.ts +++ b/src/modules/cards/infrastructure/cards.repository.ts @@ -62,9 +62,12 @@ export class CardsRepository { question = undefined, currentPage, itemsPerPage, - orderBy = 'updated-desc', + orderBy, }: GetAllCardsInDeckDto ): Promise { + if (!orderBy) { + orderBy = 'updated-desc' + } try { const where = { decks: { diff --git a/src/modules/decks/infrastructure/decks.repository.ts b/src/modules/decks/infrastructure/decks.repository.ts index f97c8af..41e99ac 100644 --- a/src/modules/decks/infrastructure/decks.repository.ts +++ b/src/modules/decks/infrastructure/decks.repository.ts @@ -59,8 +59,11 @@ export class DecksRepository { itemsPerPage, minCardsCount, maxCardsCount, - orderBy = 'updated-desc', + orderBy, }: GetAllDecksDto): Promise { + if (!orderBy) { + orderBy = 'updated-desc' + } try { const where = { cardsCount: {