Closed DavidLarsKetch closed 6 years ago
Interesting: if you delete something that has already been deleted, it returns blank. I would think it would return 0.
Yeah, so, I haven't been able to get something to send
or json
back with 204
I don't know why.
Description
We were a bit all over the place with what
DELETE
returns, and now allDELETE
functions returnthis.changes
and a200
when something was there toDELETE
and204
when something was not there toDELETE
, but the table does exist.Number of Fixes
1
Related Ticket(s)
Fixes #107, Completes #86
Problem to Solve
Inconsistent feedback was given to the user on a
DELETE
request, in particular withComputersModel
,TrainingProgramsModel
,OrdersModel
,ProductsModel
,ProductTypesModel
&PaymentOptionsModel
Accurate status codes were not being sent back fromDELETE
requestsProposed Changes
All
DELETE
requests returnthis.changes
Ifthis.changes
equals 1 (or more), sends back200
Ifthis.changes
equals 0, sends back204
Expected Behavior
If successful
DELETE
then should return1
and200
. If nothing was present at that location, but the table exists, thenDELETE
returns0
and204
.Steps to Test Solution
npm run db:generate
npm start
DELETE
http://localhost:8080/api/v1/[table-name]/1
should return200
DELETE
http://localhost:8080/api/v1/[table-name]/1
should return204
computers
,training-programs
,orders
,products
,product-types
, &payment-options
Testing