CS3219-AY2425S1 / cs3219-ay2425s1-project-g34

nus-cs3219-ay2425s1-cs3219-ay2425s1-project-project-template created by GitHub Classroom
MIT License
2 stars 1 forks source link

Update title to whitespace #17

Open ChillinRage opened 4 hours ago

ChillinRage commented 4 hours ago

Problem

Before: image Change title to a white space: image After: image

This is pretty bad as I am unable to click on the question at all, meaning I cannot edit or even delete the question. The only way is to manually delete it from the database.

Possible error

No validation on both ends result in the request title being ' ', which will be considered a string and hence why it bypassed the error that the add question had in #16.

Proposed fix

Quick fix: add .trim() to every field

Longer fix: reuse validateQuestionFields for edit question, though the function needs to be fixed first (see #16). Considering now the frontend passes all the fields for both add & update, there's no real difference in behavior between the two in regards to validation checking.