add decks crud

This commit is contained in:
2023-06-17 23:27:23 +02:00
parent 9cd6595ae2
commit 36e54cf56f
23 changed files with 405 additions and 35 deletions

View File

@@ -0,0 +1,16 @@
import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'
import { DecksRepository } from '../infrastructure/decks.repository'
import { GetAllDecksDto } from '../dto/get-all-decks.dto'
export class GetAllDecksCommand {
constructor(public readonly params: GetAllDecksDto) {}
}
@CommandHandler(GetAllDecksCommand)
export class GetAllDecksHandler implements ICommandHandler<GetAllDecksCommand> {
constructor(private readonly deckRepository: DecksRepository) {}
async execute(command: GetAllDecksCommand) {
return await this.deckRepository.findAllDecks(command.params)
}
}