mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-17 05:09:26 +00:00
update packages, fix cards entity
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { OmitType } from '@nestjs/swagger'
|
||||
|
||||
import { Pagination } from '../../../infrastructure/common/pagination/pagination.dto'
|
||||
|
||||
export class Card {
|
||||
@@ -16,8 +18,10 @@ export class Card {
|
||||
updated: Date
|
||||
}
|
||||
|
||||
export class CardWithoutRating extends OmitType(Card, ['rating'] as const) {}
|
||||
|
||||
export class PaginatedCards {
|
||||
items: Array<Omit<Card, 'userId' | 'rating'> & { grade: number }>
|
||||
items: CardWithoutRating[]
|
||||
pagination: Pagination
|
||||
}
|
||||
|
||||
@@ -25,6 +29,7 @@ export class PaginatedCardsWithGrade {
|
||||
pagination: Pagination
|
||||
items: CardWithGrade[]
|
||||
}
|
||||
|
||||
export class CardWithGrade extends Card {
|
||||
grades?: Array<{ grade: number }>
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export class CreateDeckDto {
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@Transform((val: string) => [true, 'true', 1, '1'].indexOf(val) > -1)
|
||||
@Transform(({ value }) => [true, 'true', 1, '1'].indexOf(value) > -1)
|
||||
isPrivate?: boolean
|
||||
|
||||
@ApiHideProperty()
|
||||
|
||||
Reference in New Issue
Block a user