Help edit nextjs 14 learn
Answered
Just1n posted this in #help-forum
Answered by Just1n
This part
at docs it says:
And
const UpdateInvoice = InvoiceSchema.omit({ id: true, date: true });at docs it says:
const UpdateInvoice = InvoiceSchema.omit({ id: true });And
if (!invoice) {
notFound();
}
return (
<main>
<Breadcrumbs
breadcrumbs={[
. . .13 Replies
Dunker
const UpdateInvoice = InvoiceSchema.omit({ id: true, date: true });at docs it says:
const UpdateInvoice = InvoiceSchema.omit({ id: true });@Dunker `const UpdateInvoice = InvoiceSchema.omit({ id: true, date: true });`
Giant panda
This is completely unrelated.
fetchInvoiceById returns InvoiceForm | undefined while the Form component in the screenshot only accepts a InvoiceForm which is the error because something that is possibly undefined cannot be assigned to something that must not be undefined.@Giant panda This is completely unrelated. `fetchInvoiceById` returns `InvoiceForm | undefined` while the `Form` component in the screenshot only accepts a `InvoiceForm` which is the error because something that is possibly `undefined` cannot be assigned to something that must not be `undefined`.
Dunker
Oh sorry, but this was also causing errors at some point you need to change that line
Now I remember I was stuck at there, so first check it's existence with if then render form @Just1n
if (!invoice) {
notFound();
}
return (
<main>
<Breadcrumbs
breadcrumbs={[
. . .You can remove my prev answer
sorry i'm new with next
Dunker
const UpdateInvoice = InvoiceSchema.omit({ id: true, date: true });
at docs it says:
const UpdateInvoice = InvoiceSchema.omit({ id: true });
at docs it says:
const UpdateInvoice = InvoiceSchema.omit({ id: true });
Just1nOP
thanks is working
@Just1n thanks is working
which part helped?
@aardani which part helped?
Just1nOP
This part
at docs it says:
And
const UpdateInvoice = InvoiceSchema.omit({ id: true, date: true });at docs it says:
const UpdateInvoice = InvoiceSchema.omit({ id: true });And
if (!invoice) {
notFound();
}
return (
<main>
<Breadcrumbs
breadcrumbs={[
. . .Answer