How to use the feathers-hooks-common.validateSchema function in feathers-hooks-common

To help you get started, we’ve selected a few feathers-hooks-common examples, based on popular ways it is used in public projects.

github feathers-plus / generator-feathers-plus / test-expands / cumulative-2-sequelize-services.test-expected / src1 / services / nedb-1 / nedb-1.validate.js View on Github external
let validateUpdate = options => {
  // !<DEFAULT> code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathersjs-ecosystem / feathers-hooks-common / types / tests.ts View on Github external
}
});
// $ExpectType Hook<any, Service<any>>
traverse(function(node) {
    if (typeof node === 'string') {
        this.update(node.trim());
    }
}, context => context.params.query);

// $ExpectType Hook<any, Service<any>>
validate(async (data, context) => {
    return { length: 'expected max 3, got 7' };
});

// $ExpectType Hook<any, Service<any>>
validateSchema({}, ajv);

// $ExpectType Hook<any, Service<any>>
iffElse(syncTrue, [hook1, hook2], [hook3, hook4]);
// $ExpectType Hook<any, Service<any>>
iffElse(asyncTrue, [hook1, hook2], [hook3, hook4]);

// $ExpectType IffHook
iff(syncTrue, hook1, hook2);
// $ExpectType IffHook
iff(asyncTrue, hook1, hook2);
// $ExpectType Hook<any, Service<any>>
iff(syncTrue, hook1, hook2).else(hook3, hook4);
// $ExpectType Hook<any, Service<any>>
iff(asyncTrue, hook1, hook2).else(hook3, hook4);

// $ExpectType IffHook
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.validate.ts View on Github external
let validatePatch = (options?: any) => {
  // !<DEFAULT> code: func_patch
  return validateSchema(patch, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongoose.test-expected / src1 / services / nedb-2 / nedb-2.validate.ts View on Github external
let validateUpdate = (options?: any) => {
  // !<DEFAULT> code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / test-expands / ts-cumulative-1-mongo.test-expected / src1 / services / nedb-1 / nedb-1.validate.ts View on Github external
let validateUpdate = (options?: any) => {
  // !<DEFAULT> code: func_update
  return validateSchema(update, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 07-fakes / feathers-app / src / services / roles / roles.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // !<DEFAULT> code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / js / 06-service / feathers-app / src / services / teams / teams.validate.js View on Github external
let validateCreate = options => {
  // !<DEFAULT> code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / roles / roles.validate.ts View on Github external
let validatePatch = (options?: any) => {
  // !<DEFAULT> code: func_patch
  return validateSchema(patch, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 04-model / feathers-app / src / services / users / users.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // !<DEFAULT> code: func_create
  return validateSchema(create, ajv, options);
  // !end
};
github feathers-plus / generator-feathers-plus / examples / ts / 06-service / feathers-app / src / services / teams / teams.validate.ts View on Github external
let validateCreate = (options?: any) => {
  // !<DEFAULT> code: func_create
  return validateSchema(create, ajv, options);
  // !end
};