Good Practice of Server Action in Next.js
Unanswered
Chinese Alligator posted this in #help-forum
Chinese AlligatorOP
My scenario is that i'm using server action to call a third party api from within it now what are the appropriate ways are their to rightly type it and error handle it validate it, if their is any tutorial please share it, don't share official docs as i have already read it,
2 Replies
American Chinchilla
Well like any api/middleware error handling you always want to return an http status code
Also if your using forms then you can look at validation such as zod.