Closed wenhan-lui closed 9 months ago
which means only the very first record can be changed or delete if and only if you are the first user , which is "user123", in the original piece of code. Am i right?
I cloned the repo and ran server as well as client side code locally on my machine. Changed API url, generated necessary Bearer Tokens etc. Everything including put, patch and delete works fine. I suspect there is already a fix but it isn't deployed yet on https://secrets-api.appbrewery.com.
There is currently a bug where even though a record has been created by a user, the user is not able to put/patch/delete that specific new record (e.g. ID #52).
I suspect this is due to the placement of the "return false" statement in the users.js file for the updateRecord and deleteSecretWithId functions where the "return false" statement should be placed after the for loops (i.e. Line 51 to Line 52). Otherwise, it will "return false" on the first iteration as the username will definitely not match for the new user against the first item in the records array.