diff --git a/src/modules/cards/cards.controller.ts b/src/modules/cards/cards.controller.ts index 41c50bd..0e300ce 100644 --- a/src/modules/cards/cards.controller.ts +++ b/src/modules/cards/cards.controller.ts @@ -25,7 +25,6 @@ import { import { JwtAuthGuard } from '../auth/guards' -import { CardsService } from './cards.service' import { UpdateCardDto } from './dto' import { Card } from './entities/cards.entity' import { DeleteCardByIdCommand, GetDeckByIdCommand, UpdateCardCommand } from './use-cases' @@ -33,7 +32,7 @@ import { DeleteCardByIdCommand, GetDeckByIdCommand, UpdateCardCommand } from './ @ApiTags('Cards') @Controller('cards') export class CardsController { - constructor(private readonly decksService: CardsService, private commandBus: CommandBus) {} + constructor(private commandBus: CommandBus) {} @UseGuards(JwtAuthGuard) @ApiOperation({ summary: 'Get card by id', description: 'Get card by id' }) diff --git a/src/modules/cards/infrastructure/cards.repository.ts b/src/modules/cards/infrastructure/cards.repository.ts index 5bf54c2..3f262dc 100644 --- a/src/modules/cards/infrastructure/cards.repository.ts +++ b/src/modules/cards/infrastructure/cards.repository.ts @@ -65,7 +65,7 @@ export class CardsRepository { orderBy, }: GetAllCardsInDeckDto ): Promise { - if (!orderBy) { + if (!orderBy || orderBy === 'null') { orderBy = 'updated-desc' } try { diff --git a/src/modules/decks/decks.controller.ts b/src/modules/decks/decks.controller.ts index bf63ce4..1743fe8 100644 --- a/src/modules/decks/decks.controller.ts +++ b/src/modules/decks/decks.controller.ts @@ -33,7 +33,6 @@ import { JwtAuthGuard } from '../auth/guards' import { CreateCardDto, GetAllCardsInDeckDto } from '../cards/dto' import { Card, PaginatedCards } from '../cards/entities/cards.entity' -import { DecksService } from './decks.service' import { CreateDeckDto, GetAllDecksDto, UpdateDeckDto } from './dto' import { GetRandomCardDto } from './dto/get-random-card.dto' import { Deck, DeckWithAuthor, PaginatedDecks } from './entities/deck.entity' @@ -52,7 +51,7 @@ import { @ApiTags('Decks') @Controller('decks') export class DecksController { - constructor(private readonly decksService: DecksService, private commandBus: CommandBus) {} + constructor(private commandBus: CommandBus) {} @HttpCode(HttpStatus.PARTIAL_CONTENT) @ApiOperation({ description: 'Retrieve paginated decks list.', summary: 'Paginated decks list' }) diff --git a/src/modules/decks/infrastructure/decks.repository.ts b/src/modules/decks/infrastructure/decks.repository.ts index 41e99ac..1567df3 100644 --- a/src/modules/decks/infrastructure/decks.repository.ts +++ b/src/modules/decks/infrastructure/decks.repository.ts @@ -61,7 +61,7 @@ export class DecksRepository { maxCardsCount, orderBy, }: GetAllDecksDto): Promise { - if (!orderBy) { + if (!orderBy || orderBy === 'null') { orderBy = 'updated-desc' } try {