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,
currentPage,
itemsPerPage,
orderBy = 'updated-desc',
orderBy,
}: GetAllCardsInDeckDto
): Promise<PaginatedCardsWithGrade> {
if (!orderBy) {
orderBy = 'updated-desc'
}
try {
const where = {
decks: {

View File

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