File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ exports.updateAction = (req, res) => {
21
21
. findById ( req . params . incidenceId )
22
22
. then ( incidence => {
23
23
const action = incidence . actions . id ( req . params . actionId )
24
- console . log ( action )
25
24
26
25
incidence . actions . id ( req . params . actionId ) . done = req . body . done ?? action . done
27
26
incidence . actions . id ( req . params . actionId ) . status = req . body . status ?? action . status
@@ -34,9 +33,22 @@ exports.updateAction = (req, res) => {
34
33
res . status ( 200 ) . json ( incidence )
35
34
} )
36
35
} )
36
+ . catch ( err => {
37
+ console . log ( err )
38
+ res . status ( 500 ) . json ( { msg : 'Error ' } )
39
+ } )
37
40
}
38
41
39
42
exports . getAction = ( req , res ) => {
40
43
incidencesModel
41
- . find ( )
44
+ . findById ( req . params . incidenceId )
45
+ . then ( incidence => {
46
+ const action = incidence . actions . id ( req . params . actionId )
47
+ console . log ( action )
48
+ res . status ( 200 ) . json ( action )
49
+ } )
50
+ . catch ( err => {
51
+ console . log ( err )
52
+ res . status ( 500 ) . json ( { msg : 'Error ' } )
53
+ } )
42
54
}
You can’t perform that action at this time.
0 commit comments