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 { IsEmail, IsOptional } from 'class-validator'
|
||||
import { ApiProperty, PickType } from '@nestjs/swagger'
|
||||
import { IsOptional } from 'class-validator'
|
||||
|
||||
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
|
||||
|
||||
@IsOptional()
|
||||
@ApiProperty({ required: false })
|
||||
name: string
|
||||
|
||||
@IsOptional()
|
||||
@IsEmail()
|
||||
email: string
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import { CommandHandler, ICommandHandler } from '@nestjs/cqrs'
|
||||
import { CardsRepository } from '../infrastructure/cards.repository'
|
||||
|
||||
export class DeleteCardByIdCommand {
|
||||
constructor(public readonly id: string, public readonly userId: string) {}
|
||||
constructor(
|
||||
public readonly id: string,
|
||||
public readonly userId: string
|
||||
) {}
|
||||
}
|
||||
|
||||
@CommandHandler(DeleteCardByIdCommand)
|
||||
|
||||
Reference in New Issue
Block a user