Hey there, I am doing the new MERN Stack Course of restaurant reviews.
Till now, I haven’t made it serverless yet.
When trying to add a review (logged in), and then click on submit, it shows that it was successful, however, it doesn’t show up on the frontend. When checked in the collections in MongoDB, under the reviews, it shows:
_id: ObjectId('635102f6f99e930c65921e72')
name:null,
user_id:null
date:2022-10-20T08:12:38.661+00:00
text:null,
restaurant_id:ObjectId('635102f6f99e930c65921e71')
Also, I can’t update an existing review (logged in as that user). It throws the following error in the console:
AxiosErrorcode: "ERR_BAD_RESPONSE"config: {transitional: {…}, transformRequest: Array(1), transformResponse: Array(1), timeout: 0, adapter: ƒ, …}message: "Request failed with status code 500"name: "AxiosError"request: XMLHttpRequest {onreadystatechange: null, readyState: 4, timeout: 0, withCredentials: false, upload: XMLHttpRequestUpload, …}response: {data: {…}, status: 500, statusText: 'Internal Server Error', headers: AxiosHeaders, config: {…}, …}stack: "AxiosError: Request failed with status code 500\n at settle (http://localhost:3000/static/js/bundle.js:48712:12)\n at XMLHttpRequest.onloadend (http://localhost:3000/static/js/bundle.js:47452:66)"[[Prototype]]: Error
What can be the fix for this? github repo: GitHub - sohamdata/restaurant-reviews