add timestamps

This commit is contained in:
Philipinho
2026-01-27 16:49:22 +00:00
parent 6ccb2bb872
commit 3523600f40
3 changed files with 10 additions and 0 deletions
@@ -4,6 +4,8 @@ export type ExportPageMetadata = {
icon: string | null; icon: string | null;
position: string; position: string;
parentPath: string | null; parentPath: string | null;
createdAt: string;
updatedAt: string;
}; };
export type ExportMetadata = { export type ExportMetadata = {
@@ -422,6 +422,8 @@ export class PageRepo {
'parentPageId', 'parentPageId',
'spaceId', 'spaceId',
'workspaceId', 'workspaceId',
'createdAt',
'updatedAt',
]) ])
.$if(opts?.includeContent, (qb) => qb.select('content')) .$if(opts?.includeContent, (qb) => qb.select('content'))
.where('id', '=', parentPageId) .where('id', '=', parentPageId)
@@ -438,6 +440,8 @@ export class PageRepo {
'p.parentPageId', 'p.parentPageId',
'p.spaceId', 'p.spaceId',
'p.workspaceId', 'p.workspaceId',
'p.createdAt',
'p.updatedAt',
]) ])
.$if(opts?.includeContent, (qb) => qb.select('p.content')) .$if(opts?.includeContent, (qb) => qb.select('p.content'))
.innerJoin('page_hierarchy as ph', 'p.parentPageId', 'ph.id') .innerJoin('page_hierarchy as ph', 'p.parentPageId', 'ph.id')
@@ -167,6 +167,8 @@ export class ExportService {
'pages.parentPageId', 'pages.parentPageId',
'pages.spaceId', 'pages.spaceId',
'pages.workspaceId', 'pages.workspaceId',
'pages.createdAt',
'pages.updatedAt',
]) ])
.where('spaceId', '=', spaceId) .where('spaceId', '=', spaceId)
.where('deletedAt', 'is', null) .where('deletedAt', 'is', null)
@@ -253,6 +255,8 @@ export class ExportService {
icon: page.icon ?? null, icon: page.icon ?? null,
position: page.position, position: page.position,
parentPath, parentPath,
createdAt: page.createdAt?.toISOString() ?? new Date().toISOString(),
updatedAt: page.updatedAt?.toISOString() ?? new Date().toISOString(),
}; };
if (childPages.length > 0) { if (childPages.length > 0) {