1602 / 1602/jugglingdb

TypeError: Object [Model User] has no method 'isValid'

Aperta
#310 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2k
Fork
238
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, nodejs
Ambito
backend, databases
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.