mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 05:09:26 +00:00
fix orderby
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user