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