diff --git a/apps/server/src/core/acadenice/templates/services/template-seed.service.ts b/apps/server/src/core/acadenice/templates/services/template-seed.service.ts index 7b4d9e18..52057123 100644 --- a/apps/server/src/core/acadenice/templates/services/template-seed.service.ts +++ b/apps/server/src/core/acadenice/templates/services/template-seed.service.ts @@ -35,13 +35,13 @@ const BUILT_IN_TEMPLATES: ReadonlyArray = [ { type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: 'Meeting Note' }] }, { type: 'paragraph', content: [{ type: 'text', marks: [{ type: 'bold' }], text: 'Date: ' }, { type: 'text', text: new Date().toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }) }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Attendees' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Agenda' }] }, - { type: 'orderedList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'orderedList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Notes' }] }, - { type: 'paragraph', content: [{ type: 'text', text: '' }] }, + { type: 'paragraph', content: [] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Action Items' }] }, - { type: 'taskList', content: [{ type: 'taskItem', attrs: { checked: false }, content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'taskList', content: [{ type: 'taskItem', attrs: { checked: false }, content: [{ type: 'paragraph', content: [] }] }] }, ], }, }, @@ -59,11 +59,11 @@ const BUILT_IN_TEMPLATES: ReadonlyArray = [ { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Scope' }] }, { type: 'paragraph', content: [{ type: 'text', text: 'What is in scope / out of scope?' }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Stakeholders' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Timeline' }] }, { type: 'paragraph', content: [{ type: 'text', text: 'Key milestones and deadlines.' }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Risks' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, ], }, }, @@ -77,11 +77,11 @@ const BUILT_IN_TEMPLATES: ReadonlyArray = [ content: [ { type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: 'Daily Standup' }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Yesterday' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Today' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Blockers' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, ], }, }, @@ -95,11 +95,11 @@ const BUILT_IN_TEMPLATES: ReadonlyArray = [ content: [ { type: 'heading', attrs: { level: 1 }, content: [{ type: 'text', text: 'Weekly Review' }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Wins' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Challenges' }] }, - { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'bulletList', content: [{ type: 'listItem', content: [{ type: 'paragraph', content: [] }] }] }, { type: 'heading', attrs: { level: 2 }, content: [{ type: 'text', text: 'Next Week Priorities' }] }, - { type: 'taskList', content: [{ type: 'taskItem', attrs: { checked: false }, content: [{ type: 'paragraph', content: [{ type: 'text', text: '' }] }] }] }, + { type: 'taskList', content: [{ type: 'taskItem', attrs: { checked: false }, content: [{ type: 'paragraph', content: [] }] }] }, ], }, }, diff --git a/apps/server/src/core/acadenice/templates/services/template.service.ts b/apps/server/src/core/acadenice/templates/services/template.service.ts index fefd0586..3b30ea0d 100644 --- a/apps/server/src/core/acadenice/templates/services/template.service.ts +++ b/apps/server/src/core/acadenice/templates/services/template.service.ts @@ -157,7 +157,7 @@ export class TemplateService { ${dto.icon ?? null}, ${dto.coverUrl ?? null}, ${dto.category ?? null}, - ${JSON.stringify(content)}::jsonb, + ${content as unknown as string}::jsonb, ${dto.sourcePageId ?? null}, false, ${userId} @@ -227,7 +227,7 @@ export class TemplateService { } const contentParam = dto.content - ? sql`${JSON.stringify(dto.content)}::jsonb` + ? sql`${dto.content as unknown as string}::jsonb` : sql`content`; const result = await sql` @@ -331,7 +331,7 @@ export class TemplateService { ${workspaceId}, ${userId}, ${userId}, - ${JSON.stringify(content)}::jsonb, + ${content as unknown as string}::jsonb, ${textContent ?? ''}, ${ydoc}, ${nextPosition}, @@ -461,7 +461,7 @@ export class TemplateService { ${spec.description}, ${spec.icon ?? null}, ${spec.category}, - ${JSON.stringify(spec.content)}::jsonb, + ${spec.content as unknown as string}::jsonb, true, ${systemUserId} )