File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ async (req, res) => {
49
49
winston . debug ( 'req.params: ' , req . params ) ;
50
50
winston . debug ( 'req.params.request_id: ' + req . params . request_id ) ;
51
51
52
- // sponz: 4/01/23 disable it
53
- // if (!req.body.text && (!req.body.type || req.body.type=="text") ) {
54
- // return res.status(422).json({ errors: ["text field is required"] });
55
- // }
52
+
56
53
// const errors = validationResult(req);
57
54
// if (!errors.isEmpty()) {
58
55
// return res.status(422).json({ errors: errors.array() });
@@ -103,6 +100,12 @@ async (req, res) => {
103
100
winston . debug ( "project_user" , project_user ) ;
104
101
}
105
102
103
+
104
+ // sponz: 4/01/23 disable it
105
+ if ( ! req . body . text && ( ! req . body . type || req . body . type == "text" ) ) {
106
+ return res . status ( 422 ) . json ( { errors : [ "text field is required" ] } ) ;
107
+ }
108
+
106
109
if ( sender ) {
107
110
108
111
var isObjectId = mongoose . Types . ObjectId . isValid ( sender ) ;
You can’t perform that action at this time.
0 commit comments