TypeError: Object [Model User] has no method 'isValid'
- Ngôn ngữ chính
- JavaScript
- Star
- 2k
- Fork
- 238
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
TypeError: Object [Model User] has no method 'isValid'
Please fix this.
This code does not work
User.isValid(function(valid) {
if (! valid)
{
console.log('invalid', user.errors);
}
else
{
console.log('valid');
}
});
and this one too:
User.create({name: "as", "age": "++"}, function(err, user) {
if(user.errors){
res.send({validationErrors:user.errors});
}
else
{
res.send(user);
}
});
What is wrong?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
The issue reports a missing 'isValid' method on a User model in JugglingDB. First, check the model definition and validation documentation in the project. Look at the source code for the Model class to see if 'isValid' exists or if validation works differently. Run the provided code snippets to reproduce the error, then examine how validation errors are handled in the 'create' method. Determine the correct API for validation in this ORM.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, nodejs
- Lĩnh vực
- backend, databases
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 35/100