From 016cdde654e033f4b2a8ba8116dacb77f5dde357 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 6 Jan 2026 20:03:37 +0000 Subject: [PATCH] Fix type import and nullish coalescing warnings Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- .../src/lib/db/comments/crud/get-comments.ts | 2 +- frontends/nextjs/src/lib/db/core/types.ts | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontends/nextjs/src/lib/db/comments/crud/get-comments.ts b/frontends/nextjs/src/lib/db/comments/crud/get-comments.ts index f52970be4..dfef762dc 100644 --- a/frontends/nextjs/src/lib/db/comments/crud/get-comments.ts +++ b/frontends/nextjs/src/lib/db/comments/crud/get-comments.ts @@ -26,6 +26,6 @@ export async function getComments(): Promise { content: c.content, createdAt: Number(c.createdAt), updatedAt: (c.updatedAt !== null && c.updatedAt !== undefined) ? Number(c.updatedAt) : undefined, - parentId: (c.parentId !== null && c.parentId !== undefined) ? c.parentId : undefined, + parentId: (c.parentId !== null && c.parentId !== undefined && c.parentId !== '') ? c.parentId : undefined, })) } diff --git a/frontends/nextjs/src/lib/db/core/types.ts b/frontends/nextjs/src/lib/db/core/types.ts index fa20595ce..14dd2a7f9 100644 --- a/frontends/nextjs/src/lib/db/core/types.ts +++ b/frontends/nextjs/src/lib/db/core/types.ts @@ -44,18 +44,21 @@ export interface ComponentConfig { } } +import type { User, Workflow, LuaScript, PageConfig, AppConfiguration, Comment } from '../../types/level-types' +import type { ModelSchema } from '../../types/schema-types' + /** * Full database schema type */ export interface DatabaseSchema { - users: import('../../types/level-types').User[] + users: User[] credentials: Record - workflows: import('../../types/level-types').Workflow[] - luaScripts: import('../../types/level-types').LuaScript[] - pages: import('../../types/level-types').PageConfig[] - schemas: import('../../types/schema-types').ModelSchema[] - appConfig: import('../../types/level-types').AppConfiguration - comments: import('../../types/level-types').Comment[] + workflows: Workflow[] + luaScripts: LuaScript[] + pages: PageConfig[] + schemas: ModelSchema[] + appConfig: AppConfiguration + comments: Comment[] componentHierarchy: Record componentConfigs: Record godCredentialsExpiry: number