CS-Social-Good-CalPoly / Vera

6 stars 1 forks source link

Add selected Category to backend #278

Closed kaseyliu closed 7 months ago

kaseyliu commented 7 months ago

Before, when the user selects a category, it didn't update on the database, but now the chosen category is added to the RelevantCategoryList, and the associated story is added to the Category's StoryIDList with a PUT request.

NOTE: the put request doesn't seem to work without "e.preventDefault() in the handlePost function (line 155) but this makes it so that the inputs don't clear after submission.

Screenshot 2024-03-11 at 7 03 59 PM Screenshot 2024-03-11 at 7 04 30 PM Screenshot 2024-03-11 at 7 04 52 PM
netlify[bot] commented 7 months ago

Deploy Preview for calpolyvera ready!

Name Link
Latest commit f6eda512a6ff85f14cf25c7cedddc074efdb6619
Latest deploy log https://app.netlify.com/sites/calpolyvera/deploys/6610a6e29b41770008c27e3d
Deploy Preview https://deploy-preview-278--calpolyvera.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

daiwik-swaminathan commented 7 months ago

I think I found a decent work-around to that strange issue where the second request was not being executed (made it so that it prevents default refresh behavior and then manually added it in at the end).

daiwik-swaminathan commented 7 months ago

Did also catch a bug when the user decides to switch their story category. However, this can be addressed in the next issue as the dropdown component will need to be re-worked anyway.