const joi = require(‘joi’);
joi.objectId = require(‘joi-objectid’)(joi);
function validateRental(any){
const schema = joi.object({
customerId:joi.objectId().required(),
movieId:joi.objectId().required()
});
return schema.validate(any)
};
const joi = require(‘joi’);
joi.objectId = require(‘joi-objectid’)(joi);
function validateRental(any){
const schema = joi.object({
customerId:joi.objectId().required(),
movieId:joi.objectId().required()
});
return schema.validate(any)
};