Closed Divyeshhhh closed 5 months ago
I made a few changes to the code. the code works for delete and get request methods so far.
Methods working when testing :
Errors getting when testing for each methods :
[x] GET /api/v1/products/[id]
Having the same functionality as "GET /api/v1/products", it is not filtering by the id.
[x] POST /api/v1/products
"file_get_contents("php://input"); // ! always empty for some reason" :
https://github.com/pimax/fb-messenger-php/issues/6 https://stackoverflow.com/questions/19146984/file-get-contentsphp-input-always-returns-an-empty-string
"file_get_contents("php://input"); // ! always empty for some reason" :
https://github.com/pimax/fb-messenger-php/issues/6 https://stackoverflow.com/questions/19146984/file-get-contentsphp-input-always-returns-an-empty-string
POST /api/v1/product
and DELETE /api/v1/products/[id]
now work. Try it out and use the cafe_test
db when testing API (set PROD_DB_NAME="cafe_test" in .env)
GET /api/v1/products/[id]
was always working on my end:
PUT /api/v1/products/[id]
is wrong because it calls save() method which simply creates a new record.
Checklist
Confirm you have completed the following actions prior to submitting this PR.
composer test
does not throw any error.Issue Resolution
Tell us which issue this PR fixes.
This pull request Fixes #113
Additional Information
Successfully run when tested.