mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-16 20:59:26 +00:00
fix: make avatar and name in update me request optional
This commit is contained in:
@@ -1,15 +1,14 @@
|
|||||||
import { PickType } from '@nestjs/swagger'
|
import { ApiProperty, PickType } from '@nestjs/swagger'
|
||||||
import { IsEmail, IsOptional } from 'class-validator'
|
import { IsOptional } from 'class-validator'
|
||||||
|
|
||||||
import { User } from '../entities/auth.entity'
|
import { User } from '../entities/auth.entity'
|
||||||
|
|
||||||
export class UpdateUserDataDto extends PickType(User, ['name', 'email', 'avatar'] as const) {
|
export class UpdateUserDataDto extends PickType(User, ['name', 'avatar'] as const) {
|
||||||
|
@IsOptional()
|
||||||
|
@ApiProperty({ required: false })
|
||||||
avatar: string
|
avatar: string
|
||||||
|
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
|
@ApiProperty({ required: false })
|
||||||
name: string
|
name: string
|
||||||
|
|
||||||
@IsOptional()
|
|
||||||
@IsEmail()
|
|
||||||
email: string
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,10 @@ import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'
|
|||||||
import { CardsRepository } from '../infrastructure/cards.repository'
|
import { CardsRepository } from '../infrastructure/cards.repository'
|
||||||
|
|
||||||
export class DeleteCardByIdCommand {
|
export class DeleteCardByIdCommand {
|
||||||
constructor(public readonly id: string, public readonly userId: string) {}
|
constructor(
|
||||||
|
public readonly id: string,
|
||||||
|
public readonly userId: string
|
||||||
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@CommandHandler(DeleteCardByIdCommand)
|
@CommandHandler(DeleteCardByIdCommand)
|
||||||
|
|||||||
Reference in New Issue
Block a user