diff --git a/src/app/actions/toy.ts b/src/app/actions/toy.ts index f8ce1f8..6d88497 100644 --- a/src/app/actions/toy.ts +++ b/src/app/actions/toy.ts @@ -6,7 +6,7 @@ import { createToy, updateToy, getToyById } from '@/data/operations'; import type { Toy } from '@/types'; // This type represents the data coming from the form. -export type ToyFormData = Omit & { +export type ToyFormData = Omit & { name: string; description: string; category: string; @@ -23,7 +23,7 @@ interface FormResult { } export async function createOrUpdateToy( - formData: ToyFormData & { ownerId: string }, + formData: ToyFormData & { ownerId: number }, toyId: string | null // null for create, string for update ): Promise { diff --git a/src/components/toys/AddToyForm.tsx b/src/components/toys/AddToyForm.tsx index 6db88d9..fc4b363 100644 --- a/src/components/toys/AddToyForm.tsx +++ b/src/components/toys/AddToyForm.tsx @@ -96,7 +96,7 @@ export default function AddToyForm({ initialData, isEditMode = false }: AddToyFo return; } - const toyFormData: ToyFormData & { ownerId: string } = { + const toyFormData: ToyFormData & { ownerId: number } = { name, description, category, diff --git a/toyshare.db b/toyshare.db index c4ca304..775b8e3 100644 Binary files a/toyshare.db and b/toyshare.db differ diff --git a/toyshare.db-shm b/toyshare.db-shm index 109c142..fb039ab 100644 Binary files a/toyshare.db-shm and b/toyshare.db-shm differ diff --git a/toyshare.db-wal b/toyshare.db-wal index 90fa00f..11c5ff5 100644 Binary files a/toyshare.db-wal and b/toyshare.db-wal differ