Skip to content

Commit 8dfcdf0

Browse files
committed
fix: added notes from request
1 parent 7ad57ec commit 8dfcdf0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/routes/copilotOpportunityApply/create.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
import _ from 'lodash';
2+
import validate from 'express-validation';
23

34
import models from '../../models';
45
import util from '../../util';
56
import { PERMISSION } from '../../permissions/constants';
67
import { COPILOT_OPPORTUNITY_STATUS } from '../../constants';
78

9+
const applyCopilotRequestValidations = {
10+
body: Joi.object().keys({
11+
data: Joi.object()
12+
.keys({
13+
notes: Joi.string(),
14+
}),
15+
}),
16+
};
17+
818
module.exports = [
19+
validate(applyCopilotRequestValidations),
920
async (req, res, next) => {
10-
const data = {};
21+
const data = req.body;
1122
const copilotOpportunityId = _.parseInt(req.params.id);
1223
if (!util.hasPermissionByReq(PERMISSION.APPLY_COPILOT_OPPORTUNITY, req)) {
1324
const err = new Error('Unable to apply for copilot opportunity');

0 commit comments

Comments
 (0)