ratchapong

Untitled

Oct 22nd, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. const validate = this.ajv.compile({
  2. properties: {
  3. query: {
  4. properties: {
  5. limit: { type: "number" },
  6. page: { type: "number" },
  7. sort: { type: "string" },
  8. fields: { type: "string" }
  9. },
  10. type: "object"
  11. }
  12. },
  13. required: [ "query" ],
  14. type: "object"
  15. });
  16. const valid = validate(clientInput);
  17. if (!valid) {
  18. throw _8888ACCSharedHelper.createCustomizedError(MESSAGE_ERROR_INVALID_INPUT);
  19. }
  20. const { query } = clientInput;
Advertisement
Add Comment
Please, Sign In to add comment