mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
17 lines
360 B
JavaScript
17 lines
360 B
JavaScript
const isEmpty = (str) => {
|
|
if (str.trim() === '') return true;
|
|
else return false;
|
|
};
|
|
|
|
exports.validateUpdateProfileInfo = (profileData) => {
|
|
let errors = {}
|
|
|
|
if (isEmpty(profileData.email)) {
|
|
errors.email = "Must not be empty.";
|
|
}
|
|
|
|
return {
|
|
errors,
|
|
valid: Object.keys(errors).length === 0 ? true : false
|
|
}
|
|
}; |