Make slug optional on create and auto-generate from title when omitted
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -16,13 +16,14 @@ export class CreateBusinessDto {
|
||||
@MaxLength(150)
|
||||
title!: string;
|
||||
|
||||
@ApiProperty({ example: 'shine-carwash' })
|
||||
@ApiPropertyOptional({ example: 'shine-carwash' })
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(120)
|
||||
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
|
||||
message: 'slug must be lowercase words separated by hyphens',
|
||||
})
|
||||
slug!: string;
|
||||
slug?: string;
|
||||
|
||||
@ApiProperty({ format: 'uuid' })
|
||||
@IsUUID()
|
||||
|
||||
Reference in New Issue
Block a user