File tree 1 file changed +12
-1
lines changed
src/routes/copilotOpportunityApply
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import _ from 'lodash' ;
2
+ import validate from 'express-validation' ;
2
3
3
4
import models from '../../models' ;
4
5
import util from '../../util' ;
5
6
import { PERMISSION } from '../../permissions/constants' ;
6
7
import { COPILOT_OPPORTUNITY_STATUS } from '../../constants' ;
7
8
9
+ const applyCopilotRequestValidations = {
10
+ body : Joi . object ( ) . keys ( {
11
+ data : Joi . object ( )
12
+ . keys ( {
13
+ notes : Joi . string ( ) ,
14
+ } ) ,
15
+ } ) ,
16
+ } ;
17
+
8
18
module . exports = [
19
+ validate ( applyCopilotRequestValidations ) ,
9
20
async ( req , res , next ) => {
10
- const data = { } ;
21
+ const data = req . body ;
11
22
const copilotOpportunityId = _ . parseInt ( req . params . id ) ;
12
23
if ( ! util . hasPermissionByReq ( PERMISSION . APPLY_COPILOT_OPPORTUNITY , req ) ) {
13
24
const err = new Error ( 'Unable to apply for copilot opportunity' ) ;
You can’t perform that action at this time.
0 commit comments