fix orderby

This commit is contained in:
2023-08-07 17:14:24 +02:00
parent f562d20145
commit 70a3c43c47
2 changed files with 8 additions and 2 deletions

View File

@@ -62,9 +62,12 @@ export class CardsRepository {
question = undefined, question = undefined,
currentPage, currentPage,
itemsPerPage, itemsPerPage,
orderBy = 'updated-desc', orderBy,
}: GetAllCardsInDeckDto }: GetAllCardsInDeckDto
): Promise<PaginatedCardsWithGrade> { ): Promise<PaginatedCardsWithGrade> {
if (!orderBy) {
orderBy = 'updated-desc'
}
try { try {
const where = { const where = {
decks: { decks: {

View File

@@ -59,8 +59,11 @@ export class DecksRepository {
itemsPerPage, itemsPerPage,
minCardsCount, minCardsCount,
maxCardsCount, maxCardsCount,
orderBy = 'updated-desc', orderBy,
}: GetAllDecksDto): Promise<PaginatedDecks> { }: GetAllDecksDto): Promise<PaginatedDecks> {
if (!orderBy) {
orderBy = 'updated-desc'
}
try { try {
const where = { const where = {
cardsCount: { cardsCount: {