next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

chapter 12 :Creating an invoice

Open liwenz opened this issue 1 year ago • 4 comments

I have reached chapter 12 Mutating Data. In Creating an invoice, when 3: Extract the data from formdata I follow the code: // Test it out: console.log(rawFormData); but I can't find any log I continue to the last. It should redirect, but nothing happen.

I guess async function createInvoice(formData: FormData) not be reached. But I don't know how to fix it.

the code is on https://github.com/liwenz/nextjs-dashboard

liwenz avatar Dec 15 '23 01:12 liwenz

Have you tried looking at the terminal where you started the dev server?

createInvoice() is a server action so its output would not be visible in the client (i.e browsers)

mark-P0 avatar Dec 15 '23 01:12 mark-P0

Thanks, I have checked it. Also the redirect does not work. where could I find the chapter 12 code, eg. github

liwenz avatar Dec 15 '23 02:12 liwenz

The code is fine,but my operation has some problem.Before 'createInvoice' button , I have not choosed 'Set the invoice status'.

liwenz avatar Dec 15 '23 16:12 liwenz

instead of checking in the browser check in the terminal log because that form action is on server side

Sadeeq499 avatar Apr 22 '24 19:04 Sadeeq499