Next.js Discord

Discord Forum

Help edit nextjs 14 learn

Answered
Just1n posted this in #help-forum
Open in Discord
Has anyone had this problem and been able to solve it, did I follow the entire tutorial?
Answered by Just1n
This part

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={[
        . . .
View full answer

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.
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
new error
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 });
thanks is working
@Just1n thanks is working
which part helped?
@aardani which part helped?
This part

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