Tell us what’s happening:
I have been stuck at PUT request.
You can send a PUT request to /api/issues/{projectname} with an _id and one or more fields to update. On success, the updated_on field should be updated, and returned should be { result: 'successfully updated', '_id': _id }
I have been logging the result of the update it shows the update as success and values also changed. But it is not passing the test. I am not sure what is causing the problem.
here update starts
here update ends {
_id: new ObjectId("635b62361138e801bee6bbca"),
issue_title: 'Issue to be Updated',
issue_text: 'New Issue Text',
created_on: 2022-10-28T05:01:19.345Z,
updated_on: 2022-10-28T05:01:43.684Z,
created_by: 'fCC',
assigned_to: '',
open: true,
status_text: '',
project_name: 'fcc-project',
__v: 0
}
Finally figured it out.
There seems to be an error in my GET request.
After updating the results are checked through GET request.
I have not included _id in my GET request which is parameter for checking successful update.
After including _id in my GET test is cleared up.
In get request you are finding issue with diff variables, you have to also include _id paramater for finding new issue, put request uses that _id to call get method, to check whether issue has been updated.