File tree 1 file changed +5
-6
lines changed
src/routes/copilotOpportunityApply
1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,14 @@ import { COPILOT_OPPORTUNITY_STATUS } from '../../constants';
9
9
10
10
const applyCopilotRequestValidations = {
11
11
body : Joi . object ( ) . keys ( {
12
- data : Joi . object ( )
13
- . keys ( {
14
- notes : Joi . string ( ) ,
15
- } ) ,
12
+ notes : Joi . string ( ) ,
16
13
} ) ,
17
14
} ;
18
15
19
16
module . exports = [
20
17
validate ( applyCopilotRequestValidations ) ,
21
18
async ( req , res , next ) => {
22
- const data = req . body ;
23
- console . log ( data , 'debug data' ) ;
19
+ const { notes } = req . body ;
24
20
const copilotOpportunityId = _ . parseInt ( req . params . id ) ;
25
21
if ( ! util . hasPermissionByReq ( PERMISSION . APPLY_COPILOT_OPPORTUNITY , req ) ) {
26
22
const err = new Error ( 'Unable to apply for copilot opportunity' ) ;
@@ -36,8 +32,11 @@ module.exports = [
36
32
createdBy : req . authUser . userId ,
37
33
updatedBy : req . authUser . userId ,
38
34
opportunityId : copilotOpportunityId ,
35
+ notes : notes ? req . sanitize ( notes ) : null ,
39
36
} ) ;
40
37
38
+ console . log ( data , 'debug data data' ) ;
39
+
41
40
return models . CopilotOpportunity . findOne ( {
42
41
where : {
43
42
id : copilotOpportunityId ,
You can’t perform that action at this time.
0 commit comments