Add AI-generated title and description for new comic stories

This commit is contained in:
Riccardo Giorato
2025-12-26 21:31:30 +01:00
parent 8d19367b34
commit 0710982f9d
4 changed files with 496 additions and 331 deletions
+6
View File
@@ -42,6 +42,12 @@ export async function updatePage(pageId: string, generatedImageUrl: string): Pro
.where(eq(pages.id, pageId));
}
export async function updateStory(storyId: string, data: { title?: string; description?: string }): Promise<void> {
await db.update(stories)
.set({ ...data, updatedAt: new Date() })
.where(eq(stories.id, storyId));
}
export async function getStoryWithPages(storyId: string): Promise<{ story: Story; pages: Page[] } | null> {
const storyResult = await db.select().from(stories).where(eq(stories.id, storyId)).limit(1);