move files around

This commit is contained in:
Ben Ramey
2018-09-20 06:46:02 -05:00
parent 8eba063aef
commit 4e114f8de4
5 changed files with 8 additions and 10 deletions

View File

@@ -20,7 +20,7 @@ const parseAndValidateBody = async (schema, body) => {
};
const validateBody = (schema, body) => {
const ajv = new Ajv();
const ajv = new Ajv({$data: true});
const validate = ajv.compile(schema);
const isValid = validate(body);

View File

@@ -1,15 +0,0 @@
const courseSchema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"num_tests": {"type": "number"},
"num_questions_per_test": {"type": "number"},
"answers": {"type": "array"}
},
"required": ["name", "num_tests", "num_questions_per_test", "answers"]
};
module.exports = {
courseSchema
};