Got API 404 Error- Xano Post Request from Form

I created a Profile Edit page that has a form container. I want users to be able to update the form and click submit to update the profile. I bound the form fields to my database files so that the form is pre-populated with some info. My database is Xano and I placed a Workflow on the form container. When I usedthe page preview and made some updates to the form, as a user, and clicked submit. the Profile page didn’t update and I can see that my Xano User table was not updated as well. I’ve going back through the steps, but do not see what I may be doing wrong.





Here is the error code.

Failed :rotating_light:

Error: Request failed with status code 400

Error:

name: “Error”

stack: “Error: Request failed with status code 400 at e.exports (https://editor-cdn.weweb.io/public/js/chunk-vendors.30212033.js:64:1241) at e.exports (https://editor-cdn.weweb.io/public/js/chunk-vendors.30212033.js:97:3739) at XMLHttpRequest.w (https://editor-cdn.weweb.io/public/js/chunk-vendors.30212033.js:262:2151)”

message: “Request failed with status code 400”

isAxiosError: true

toJSON: function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}

configObject

requestObject

responseObject

It may be a missing parameter in the request. Maybe “role” is required. Maybe it should be this user’s role.

If you look in the response object you can find some helpful message:

Are you sure you are posting to the right endpoint? Are you creating an user or updating an user?
In my example the endpoint is /products/{products_id} because I am updating a product. /products would create a new one.
image

It may be good to show a popup with an error message with the “on error” workflow so that the user knows that the profile update failed.

Hi, Dorilama. Thanks for the reply. Right now I have the profile info in my user table, but I plan to separate this out once I learn how to create a relational database for the profile info that auto-creates an entry in the database whenever a new user is added to the user database. Currently, I haven’t implemented anything with the role field and it’s not a part of my form. In the near future, I will add some role base functionality to my app.

Xano has a function for Add/Edit where it checks if I’m creating something new or updating current information. I’m definitely with you on adding the success message. I plan to do that.