Tell us what’s happening:
Hi, I’m currently working on the issue tracker in the quality assurance certification.
I was able to make the POST function (aka creating an issue), and moved onto the PUT and DELETE api.
currently, the following test passes: ’
When the PUT
request sent to /api/issues/{projectname}
does not include an _id
, the return value is { error: 'missing _id' }
’
but none of the other PUT requests nor the delete request pass. When I try out updating an issue on the webview, it works for me with all the cases of:
-when there is an id, but no update fields, I’m getting the following: {"error":"no update field(s) sent","_id":"[with whatever id I entered]"}
-when there is an id, update fields, but the id is not valid, I’m getting: {"error":"could not update","_id":"[with whatever invalid id I entered]"}
-when there is a valid id and update fields, I’m getting: {"result":"successfully updated","_id":"654949a1999bbc8c7519e207"}
and checking with my mongoDB it updated it correctly.
I’m not sure whats wrong with my code for it to not pass for that specific test.
I’ve tried the same with the delete, and on my webview, it’s working.
I’ve checked with the github, to take a look at the exact tests it is doing: https://github.com/freeCodeCamp/freeCodeCamp/blob/main/curriculum/challenges/english/06-quality-assurance/quality-assurance-projects/issue-tracker.md
and couldnt find why it wouldnt pass.
I also checked with the sample website: https://issue-tracker.freecodecamp.rocks/
and I found that it works differently. It doesn’t give an error message when updating an issue without any update fields, it actually gives the result of successfully updated.
and on the delete issue, it doesnt give an error message if it’s an invalid id, it doesnt give any result.
I’m a bit stumped on what is causing the issue for my tests not to pass, would anybody mind taking a look?
Your code so far
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0
Challenge:
issue tracker
Link to the challenge: