usesOwnApiKey
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ import { stories, pages, type Story, type Page } from './schema';
|
||||
import { eq } from 'drizzle-orm';
|
||||
import { generateComicSlug } from './slug-generator';
|
||||
|
||||
export async function createStory(data: { title: string; description?: string; userId: string; style?: string }): Promise<Story> {
|
||||
export async function createStory(data: { title: string; description?: string; userId: string; style?: string; usesOwnApiKey?: boolean }): Promise<Story> {
|
||||
// Generate a unique slug
|
||||
let slug = generateComicSlug();
|
||||
let attempts = 0;
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
import { pgTable, text, integer, timestamp, uuid, jsonb } from 'drizzle-orm/pg-core';
|
||||
import { pgTable, text, integer, timestamp, uuid, jsonb, boolean } from 'drizzle-orm/pg-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
|
||||
// Stories table
|
||||
@@ -9,6 +9,7 @@ export const stories = pgTable('stories', {
|
||||
description: text('description'),
|
||||
style: text('style').default('noir').notNull(),
|
||||
userId: text('user_id').notNull(),
|
||||
usesOwnApiKey: boolean('uses_own_api_key').default(false),
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
updatedAt: timestamp('updated_at').defaultNow().notNull(),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user