mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 12:33:22 +00:00
file upload in progress
This commit is contained in:
@@ -8,13 +8,16 @@ import { pick } from 'remeda'
|
||||
export class GetRandomCardInDeckCommand {
|
||||
constructor(public readonly userId: string, public readonly deckId: string) {}
|
||||
}
|
||||
|
||||
type CardWithGrade = Prisma.cardGetPayload<{ include: { grades: true } }>
|
||||
|
||||
@CommandHandler(GetRandomCardInDeckCommand)
|
||||
export class GetRandomCardInDeckHandler implements ICommandHandler<GetRandomCardInDeckCommand> {
|
||||
constructor(
|
||||
private readonly cardsRepository: CardsRepository,
|
||||
private readonly decksRepository: DecksRepository
|
||||
) {}
|
||||
|
||||
private async getSmartRandomCard(cards: Array<CardWithGrade>) {
|
||||
const selectionPool: Array<CardWithGrade> = []
|
||||
cards.forEach(card => {
|
||||
|
||||
Reference in New Issue
Block a user