Next.js Project Works in One Branch, API Requests Fail in Another
I'm working on a project using Next.js where I have two separate branches. The code works perfectly in one branch, but I'm encountering issues with API requests in the other branch. The code in both branches is almost identical, but in the non-working branch, the data I send is being accepted as empty on the backend, and I'm getting an error.
Here’s the code I’m using:
The data I’m sending to the API:
sending data {title: 'test4', company: 'test', city: 'test2', country: 'tst', description: 'asdasda', ...}
The error I receive:
error: 'null value in column "title" of relation "core_exp..."'
I'm only able to log into my project with part of the code, but I'm encountering issues when trying to update the form fields.
Things I've tried to resolve the issue:
Checked the .env files; they have the same values. Ensured that the library versions are the same. Verified that the API endpoints are correct. Checked that the Redux state is being updated properly.
I compared most of my code and did not find any significant differences. Even on some pages, I observe that although I receive a 200 response from the backend, the changes I made are not being updated. This indicates that, despite the form data being sent correctly, the updates are not reflecting.
What could be causing this issue, and how can I fix it? I’m open to any suggestions. Thank you!
Things I've tried to resolve the issue:
1.Checked the .env files; they have the same values. 2.Ensured that the library versions are the same. 3.Verified that the API endpoints are correct. 4.Checked that the Redux state is being updated properly.
I compared most of my code and did not find any significant differences. Even on some pages, I observe that although I receive a 200 response from the backend, the changes I made are not being updated. This indicates that, despite the form data being sent correctly, the updates are not reflecting.