Closed lgg closed 6 years ago
What is the error output?
@jlin816 on server side in console:
PUT /api/users/SOMETOKENHERE/profile 500 171.183 ms - 66
On client side: Oops, something went wrong
Tried to reinstall npm modules - didn't help. I have made some localization for text, so on client side:
On server side:
Hmm, i even don't understand how i can debug it :/
Such user contains in MongoDB
Shame on me :/
For others: check MongoDB schema and Users model.
I have this code in User.js:
schema.statics.validateProfile = function(profile, cb){
return cb(!(
profile.name.length > 0 &&
profile.adult &&
profile.school.length > 0 &&
['2018 2019 2020 2021 2022 2023 2024 2025'].indexOf(profile.graduationYear) > -1 &&
['M', 'F', 'O', 'N'].indexOf(profile.gender) > -1
));
};
But correct one is:
schema.statics.validateProfile = function(profile, cb){
return cb(!(
profile.name.length > 0 &&
profile.adult &&
profile.school.length > 0 &&
['2018', '2019', '2020', '2021', '2022', '2023', '2024', '2025'].indexOf(profile.graduationYear) > -1 &&
['M', 'F', 'O', 'N'].indexOf(profile.gender) > -1
));
};
Everything works fine Changed graduation years in
run
gulp server
Now can't save application form
PUT /api/users/SOMETOKENHERE/profile 500 171.183 ms - 66
I checked #1 but it seems that function https://github.com/techx/quill/issues/1#issuecomment-248448059 is already updated