afoGroup/webdev-sp21-afo-client-react

Sending Blank String "" to DB - [LOW PRIORITY]

Opened this issue · 2 comments

In the pic u see that the fields that are blank was sent to the DB as "", with the exception of pictureURL. pictureURL wasn't sent to db and is still null. This probably wont cause that many issues but we would have to check for blank and null potentially.

176886030_477550743683355_3323944123918635449_n

Fix could be on server side to check if length of string? But this gets a bit complicated because I don't set the variables individually. I just send the user as is to the DB. 🤔

Issue was here within the register method; bolded:

const register = () => {
setCredentials({
password: password,
username: username,
usertype: type,
bio: '',
email: email,
instagram: instagram,
pictureurl: imageUrl,
twitter: twitter
})
....

Updated the param to 'pictureURL' and tested register successfully (value posted as blank instead of NULL). Changes are currently implemented on the tom-client branch but can be merged into main at a later date.

Thinking we can keep this open until then? Thanks!

Tom