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:
Jason Woltje
2026-01-29 16:16:49 -06:00
parent 4729f964f1
commit 81d426453a
4 changed files with 42 additions and 76 deletions

View File

@@ -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}$/, {

View File

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