user dashboard not show new toy after add new toy for sharing, and new t

This commit is contained in:
Indigo Tang 2025-07-06 13:52:21 +00:00
parent 0b22c28dfa
commit e6491b8440
5 changed files with 3 additions and 3 deletions

View File

@ -6,7 +6,7 @@ import { createToy, updateToy, getToyById } from '@/data/operations';
import type { Toy } from '@/types'; import type { Toy } from '@/types';
// This type represents the data coming from the form. // 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; name: string;
description: string; description: string;
category: string; category: string;
@ -23,7 +23,7 @@ interface FormResult {
} }
export async function createOrUpdateToy( export async function createOrUpdateToy(
formData: ToyFormData & { ownerId: string }, formData: ToyFormData & { ownerId: number },
toyId: string | null // null for create, string for update toyId: string | null // null for create, string for update
): Promise<FormResult> { ): Promise<FormResult> {

View File

@ -96,7 +96,7 @@ export default function AddToyForm({ initialData, isEditMode = false }: AddToyFo
return; return;
} }
const toyFormData: ToyFormData & { ownerId: string } = { const toyFormData: ToyFormData & { ownerId: number } = {
name, name,
description, description,
category, category,

Binary file not shown.

Binary file not shown.

Binary file not shown.