user dashboard not show new toy after add new toy for sharing, and new t
This commit is contained in:
parent
0b22c28dfa
commit
e6491b8440
|
|
@ -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<Toy, 'id' | 'name' | 'description' | 'category' | 'images' | 'unavailableRanges' | 'pricePerDay' | 'location' | 'ownerName' | 'ownerAvatarUrl' | 'dataAiHint'> & {
|
||||
export type ToyFormData = Omit<Toy, 'id' | 'ownerId' | 'name' | 'description' | 'category' | 'images' | 'unavailableRanges' | 'pricePerDay' | 'location' | 'ownerName' | 'ownerAvatarUrl' | 'dataAiHint'> & {
|
||||
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<FormResult> {
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
BIN
toyshare.db
BIN
toyshare.db
Binary file not shown.
BIN
toyshare.db-shm
BIN
toyshare.db-shm
Binary file not shown.
BIN
toyshare.db-wal
BIN
toyshare.db-wal
Binary file not shown.
Loading…
Reference in New Issue