
Jimmy Tumialan ʕ•̫͡•ʔ
Preguntastudent•hace 4 años
<[12:33:57 PM] File change detected. Starting incremental compilation... src/services/products/products.service.ts:45:9 - error TS2322: Type '{ name: string; description: string; price: number; stock: number; image: string; id: number; } | { name: string; description?: string; price?: number; stock?: number; image?: string; message: string; stack?: string; }' is not assignable to type 'Product'. Property 'id' is missing in type '{ name: string; description?: string; price?: number; stock?: number; image?: string; message: string; stack?: string; }' but required in type 'Product'. 45 this.products[index] = {...product, ...payload}; ~~~~~~~~~~~~~~~~~~~~ src/entities/product.entity.ts:2:5 2 id: number; ~~ 'id' is declared here. [12:33:57 PM] Found 1 error. Watching for file changes. >

Nicolas Molina
teacher•hace 4 años
Al parecer payload no es compatible con el tipado tiene product, ¿Nos podrás compartir tu código?, para verlo más a detalle.