fix: code review cleanup
- Added missing API functions: fetchKnowledgeStats, fetchEntryGraph - Exported StatsDashboard and EntryGraphViewer components - Replaced 'any' types with proper TypeScript types: * AuthUser for @CurrentUser parameters * Prisma.KnowledgeEntryWhereInput for where clauses * Prisma.KnowledgeEntryUpdateInput for update data * Prisma.TransactionClient for transaction parameters - All TypeScript checks passing - XSS protection verified in WikiLinkRenderer (escapeHtml function) - Wiki-link parsing properly handles code blocks and escaping
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
NotFoundException,
|
||||
ConflictException,
|
||||
} from "@nestjs/common";
|
||||
import { EntryStatus } from "@prisma/client";
|
||||
import { EntryStatus, Prisma } from "@prisma/client";
|
||||
import slugify from "slugify";
|
||||
import { PrismaService } from "../prisma/prisma.service";
|
||||
import type { CreateEntryDto, UpdateEntryDto, EntryQueryDto } from "./dto";
|
||||
@@ -41,7 +41,7 @@ export class KnowledgeService {
|
||||
const skip = (page - 1) * limit;
|
||||
|
||||
// Build where clause
|
||||
const where: any = {
|
||||
const where: Prisma.KnowledgeEntryWhereInput = {
|
||||
workspaceId,
|
||||
};
|
||||
|
||||
@@ -308,7 +308,7 @@ export class KnowledgeService {
|
||||
}
|
||||
|
||||
// Build update data object conditionally
|
||||
const updateData: any = {
|
||||
const updateData: Prisma.KnowledgeEntryUpdateInput = {
|
||||
updatedBy: userId,
|
||||
};
|
||||
|
||||
@@ -764,7 +764,7 @@ export class KnowledgeService {
|
||||
* Sync tags for an entry (create missing tags, update associations)
|
||||
*/
|
||||
private async syncTags(
|
||||
tx: any,
|
||||
tx: Prisma.TransactionClient,
|
||||
workspaceId: string,
|
||||
entryId: string,
|
||||
tagNames: string[]
|
||||
|
||||
Reference in New Issue
Block a user