fix(knowledge): fix type safety issues in entry CRUD API (KNOW-002)
- Remove @nestjs/swagger decorators (package not installed) - Fix controller to use @Request() req for accessing workspaceId - Fix service to properly handle nullable Prisma fields (summary) - Fix update method to conditionally build update object - Add missing tag DTOs to satisfy dependencies Resolves compilation errors and ensures type safety.
This commit is contained in:
@@ -15,16 +15,6 @@ export class CreateTagDto {
|
||||
@MaxLength(100, { message: "name must not exceed 100 characters" })
|
||||
name!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString({ message: "slug must be a string" })
|
||||
@MinLength(1, { message: "slug must not be empty" })
|
||||
@MaxLength(100, { message: "slug must not exceed 100 characters" })
|
||||
@Matches(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
|
||||
message:
|
||||
"slug must be lowercase, alphanumeric, and may contain hyphens (e.g., 'my-tag-name')",
|
||||
})
|
||||
slug?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString({ message: "color must be a string" })
|
||||
@Matches(/^#[0-9A-Fa-f]{6}$/, {
|
||||
|
||||
@@ -7,8 +7,7 @@ import {
|
||||
} from "class-validator";
|
||||
|
||||
/**
|
||||
* DTO for updating an existing knowledge tag
|
||||
* All fields are optional to support partial updates
|
||||
* DTO for updating a knowledge tag
|
||||
*/
|
||||
export class UpdateTagDto {
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user