thosakwe / feathers-validator Goto Github PK
View Code? Open in Web Editor NEWWIP. A validator for Feathers services, or any service.
Home Page: https://www.npmjs.com/package/feathers-validator
License: GNU General Public License v2.0
WIP. A validator for Feathers services, or any service.
Home Page: https://www.npmjs.com/package/feathers-validator
License: GNU General Public License v2.0
find out activeurl or not .
Instead just returning the array for errors how to get errors in key value like laravel format.
Hello, i am making unique validator function. But encountered a problem , the response of query is coming after return can you help me with this.
function generateUniqueValidatorFunction(params, data){
"use strict";
return function (key, value){
var query = {};
var res;
query[params[1]] = data[params[1]];
hook.app.service(hook.path).find({query: query }).then(function(found){
console.log('found '+ JSON.stringify(found));
if(found.data.length > 0){
return { valid: true };
}else{
return {
valid: false,
error: 'The '+ key + ' must be unique.'
};
}
});
}
}
Please Help!!!!!
log:
app:services:user data { fullName: 'test name', password: '123456' } +0ms
app:services:user rule { fullName: 'required|min:6', password: 'required|min:6' } +3ms
app:services:user errors [ 'The size of the password field must be greater than or equal to 6.' ] +2ms
Sorry for my ignorance..., but when do you need this validator? I am working with sequelize within feathersjs. As the ORM already provides 'validation rules' I do not think I need it, but maybe I just don't get it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.