steamysips / steamy-sips

A full-stack LAMP e-commerce coffee shop.
https://steamysips.github.io/steamy-sips/
Creative Commons Attribution Share Alike 4.0 International
0 stars 0 forks source link

complete api/Products controller #164

Closed Divyeshhhh closed 5 months ago

Divyeshhhh commented 5 months ago

Checklist

Confirm you have completed the following actions prior to submitting this PR.

Issue Resolution

Tell us which issue this PR fixes.

This pull request Fixes #113

Additional Information

Successfully run when tested.

creme332 commented 5 months ago

I made a few changes to the code. the code works for delete and get request methods so far.

Divyeshhhh commented 5 months ago

Methods working when testing :

Errors getting when testing for each methods :

image

"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

image

image

"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

creme332 commented 5 months ago

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: image