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

Duplicate titles #18

Open ChillinRage opened 2 hours ago

ChillinRage commented 2 hours ago

Problem

Adding and Editing (note the extra spaces between to and Integer): image

After: image

Possible error

.trim() does not remove the whitespaces in between characters. So in the system they are saved as different titles. But the html/React automatically trims any extra white spaces between characters (unless specified using a special string), which is why the table displays both as 1 space and seem to be duplicates.

Is this considered a real problem? Idk tbh. From the users' side it will seem like a bug, but it does not affect the usability of the app.

Proposed fix

reformat by: split string > remove all empty string elements > .join(' ') > proceed with validation.

ChillinRage commented 2 hours ago

sorry for the issue spams, I can fix all these issues if y'all dm.