v17 was created by restoring v12
I can see the issue! The Postman screenshot shows the API expects the payload with fields: name, category, customer, location, image, condition, and value.
The problem is that the form uses "client" but the API endpoint expects "customer". I need to:
Let me read the current asset form and submission code to fix this:
Now let me read the assets page submission handler to see how the form data is being sent:
I can see the issue. The handleSubmit in assets/page.tsx is already mapping data.client to customer, but the values are coming through as strings or empty. The problem is in the form validation - it's checking for truthy values but category and client might be empty strings. Let me fix the form submission to ensure values are properly validated and sent:
Now I need to update the asset form modal to properly send the data. The issue is that category and client need to have actual values. Let me check the form rendering to ensure it's capturing the values correctly:
I see the issue. The category field stores the category name (from the select option), but according to the Postman screenshot, it should send the numeric ID. Also, the customer field should accept numeric input. Let me fix the form to send the correct data format:
Now let me update the customer field to accept numeric input and ensure proper validation:
I've fixed the asset form to properly send the payload in the format your API expects. The key changes are:
cat.name to cat.idclient field to customer in the FormData, and trims whitespace to prevent undefined valuesThe payload will now correctly send: name, category (numeric ID), customer (numeric ID), location, value, condition, and image - exactly matching your Postman screenshot format.
quote delete:
delete: {{baseURL}}/api/quotes/admin/create
payload:
{
"id": 1