You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While struggling to to learn how to write the correct query
to delete only one record, I tried no query and the default of
delete all records was performed.
see the response is quantity three pre-populated todos
id's 1, 2 and 4 .
WARNING: about to (accidentally) delete all the todos in the list!
d. Click button DELETE /todo-lists/{id}/todos
Click Try It out
Enter 1 for the id number of the first list
remove the default query
press the execute button
see the response is
{
"count": 3
}
e. Re-perform step c. above to see the result is [], an
empty array. All records have been unceremoniously deleted
from list 1! The list count is still { "count": 2 }.
Current Behavior
Default (accidental) delete of all records.
Expected Behavior
My expectation is that at least nothing would happen
accidentally. Even better, no delete-all would occur
and that a somewhat helpfull error message would be
returned stating that an empty query is not allowed with
a delete request.
This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.
Steps to reproduce
lb4 example todo-list cd loopback4-example-todo-list npm start
Browse to the API explorer at http://127.0.0.1:3000
Notice that the database is prepopulated
a. With GET todo-lists/count
Try It out
execute
button{ "count": 2 }
b. With button GET todo-lists/
Try It out
c. Click button
GET /todo-lists/{id}/todos
Try It out
1
for the id number of the first listid's 1, 2 and 4 .
WARNING: about to (accidentally) delete all the todos in the list!
d. Click button
DELETE /todo-lists/{id}/todos
Try It out
1
for the id number of the first listexecute
button{ "count": 3 }
e. Re-perform step c. above to see the result is
[]
, anempty array. All records have been unceremoniously deleted
from list 1! The list count is still { "count": 2 }.
Current Behavior
Expected Behavior
accidentally. Even better, no delete-all would occur
and that a somewhat helpfull error message would be
returned stating that an empty query is not allowed with
a delete request.
Link to reproduction sandbox
N/A
Additional information
@loopback/[email protected] /home/northdecoder/workspace/loopback4-example-todo-list
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── [email protected]
Related Issues
Thinking this may have already been discussed, I read through
a bunch of issues with 'delete' somewhere in the text. Not sure
of the relevance.
Issue #
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: