Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
contactName: Joi.string(),
contactPhone: Joi.string(),
contactEmail: Joi.string(),
description: Joi.string(),
address: Joi.string(),
location: Joi.object({
type: Joi.string().default("Point"),
coordinates: Joi.array()
.length(2)
.items(Joi.number())
}),
notes: Joi.string(),
tags: Joi.array().items(Joi.string())
}),
params: {
resource_id: Joi.objectId().required()
}
}),
errorWrap(async (req, res) => {
const data = req.body;
const resourceId = req.params.resource_id;
const resource = await Resource.findByIdAndUpdate(
resourceId,
{ $set: data },
{ new: true }
);
const ret = resource
? {
code: 200,
message: "Resource Updated Successfully",