VdotR / SnapPoll

https://snappoll-backend.vercel.app
0 stars 0 forks source link

Continued Refactor #16

Closed cbaeucsd closed 2 months ago

cbaeucsd commented 3 months ago

Moved all api fetches to utils Ended up redoing a lot of the pages' functions, some of it unnecessarily due to changing how functions were stored in util midway, some necessarily to fix bugs. Decided to add a length max to email,username,password. Made created_polls no longer return 400 if user has no polls, bad behavior imo.

Since I touched every API call, there are a lot of things that could've been broken. I didn't find any, but try to be thorough before approving.

cbaeucsd commented 3 months ago

Issue was able to be recreated and solved as suggested.

trdavidt commented 3 months ago

Great, thanks! All the other fetch utils I tested worked fine. One issue however is that the message in the /signup response with a long password is "Invalid input data" instead of something indicating the password is too long. For example, it would tell you if email is invalid but not when password is too long. Was this intended?

cbaeucsd commented 2 months ago

Signup should give more helpful messages on what isn't allowed now.