move files around
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user