update packages, fix cards entity

This commit is contained in:
2023-11-19 15:46:20 +01:00
parent 02cd24da5f
commit fbf5236f80
5 changed files with 9828 additions and 9166 deletions

View File

@@ -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 }>
}

View File

@@ -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()