박권수

fix syntax : syntax is changed

......@@ -28,6 +28,7 @@ mongoose
useNewUrlParser: true,
useFindAndModify: false,
useUnifiedTopology: true,
useCreateIndex : true
})
.then(() => {
console.log("Connected to MongoDB");
......
......@@ -14,7 +14,7 @@ exports.register = async (ctx) => {
password: Joi.string().required(),
});
const result = Joi.validate(ctx.request.body, schema);
const result = schema.validate(ctx.request.body);
if (result.error) {
ctx.status = 400;
ctx.body = result.error;
......
......@@ -51,7 +51,7 @@ exports.setProfile = async (ctx) => {
})
.unknown();
console.log(ctx.request.body);
const result = Joi.validate(ctx.request.body, schema);
const result = schema.validate(ctx.request.body);
if (result.error) {
ctx.status = 400;
ctx.body = result.error;
......