- Added EntryVersion model with author relation - Implemented automatic versioning on entry create/update - Added API endpoints for version history: - GET /api/knowledge/entries/:slug/versions - list versions - GET /api/knowledge/entries/:slug/versions/:version - get specific - POST /api/knowledge/entries/:slug/restore/:version - restore version - Created VersionHistory.tsx component with timeline view - Added History tab to entry detail page - Supports version viewing and restoring - Includes comprehensive tests for version operations - All TypeScript types are explicit and type-safe
16 lines
350 B
TypeScript
16 lines
350 B
TypeScript
import {
|
|
IsString,
|
|
IsOptional,
|
|
MaxLength,
|
|
} from "class-validator";
|
|
|
|
/**
|
|
* DTO for restoring a previous version of a knowledge entry
|
|
*/
|
|
export class RestoreVersionDto {
|
|
@IsOptional()
|
|
@IsString({ message: "changeNote must be a string" })
|
|
@MaxLength(500, { message: "changeNote must not exceed 500 characters" })
|
|
changeNote?: string;
|
|
}
|