mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-18 05:09:29 +00:00
add decks documentation
This commit is contained in:
@@ -1 +1,20 @@
|
||||
export class Card {}
|
||||
import { Pagination } from '../../../infrastructure/common/pagination/pagination.dto'
|
||||
|
||||
export class Card {
|
||||
id: string
|
||||
deckId: string
|
||||
userId: string
|
||||
question: string
|
||||
answer: string
|
||||
shots: number
|
||||
answerImg: string
|
||||
questionImg: string
|
||||
rating: number
|
||||
created: Date
|
||||
updated: Date
|
||||
}
|
||||
|
||||
export class PaginatedCards {
|
||||
items: Card[]
|
||||
pagination: Pagination
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createPrismaOrderBy } from '../../../infrastructure/common/helpers/get-
|
||||
import { Pagination } from '../../../infrastructure/common/pagination/pagination.service'
|
||||
import { PrismaService } from '../../../prisma.service'
|
||||
import { CreateCardDto, GetAllCardsInDeckDto, UpdateCardDto } from '../dto'
|
||||
import { PaginatedCards } from '../entities/cards.entity'
|
||||
|
||||
@Injectable()
|
||||
export class CardsRepository {
|
||||
@@ -59,7 +60,7 @@ export class CardsRepository {
|
||||
itemsPerPage,
|
||||
orderBy,
|
||||
}: GetAllCardsInDeckDto
|
||||
) {
|
||||
): Promise<PaginatedCards> {
|
||||
try {
|
||||
const where = {
|
||||
decks: {
|
||||
|
||||
Reference in New Issue
Block a user