File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,14 +8,13 @@ import rest from '../rest.js'
88router . route ( '/' )
99 . patch ( auth . checkJwt , controller . patchSet )
1010 . post ( auth . checkJwt , ( req , res , next ) => {
11- if ( rest . checkPatchOverrideSupport ( req , res ) ) {
12- controller . patchSet ( req , res , next )
13- }
14- else {
11+ if ( ! rest . checkPatchOverrideSupport ( req , res ) ) {
1512 res . statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.'
1613 res . status ( 405 )
1714 next ( res )
15+ return
1816 }
17+ controller . patchSet ( req , res , next )
1918 } )
2019 . all ( ( req , res , next ) => {
2120 res . statusMessage = 'Improper request method for updating, please use PATCH to add new keys to this object.'
Original file line number Diff line number Diff line change @@ -8,14 +8,13 @@ import rest from '../rest.js'
88router . route ( '/' )
99 . patch ( auth . checkJwt , controller . patchUnset )
1010 . post ( auth . checkJwt , ( req , res , next ) => {
11- if ( rest . checkPatchOverrideSupport ( req , res ) ) {
12- controller . patchUnset ( req , res , next )
13- }
14- else {
11+ if ( ! rest . checkPatchOverrideSupport ( req , res ) ) {
1512 res . statusMessage = 'Improper request method for updating, please use PATCH to remove keys from this object.'
1613 res . status ( 405 )
1714 next ( res )
15+ return
1816 }
17+ controller . patchUnset ( req , res , next )
1918 } )
2019 . all ( ( req , res , next ) => {
2120 res . statusMessage = 'Improper request method for updating, please use PATCH to remove keys from this object.'
Original file line number Diff line number Diff line change @@ -9,14 +9,13 @@ import auth from '../auth/index.js'
99router . route ( '/' )
1010 . patch ( auth . checkJwt , controller . patchUpdate )
1111 . post ( auth . checkJwt , ( req , res , next ) => {
12- if ( rest . checkPatchOverrideSupport ( req , res ) ) {
13- controller . patchUpdate ( req , res , next )
14- }
15- else {
12+ if ( ! rest . checkPatchOverrideSupport ( req , res ) ) {
1613 res . statusMessage = 'Improper request method for updating, please use PATCH to alter the existing keys this object.'
1714 res . status ( 405 )
1815 next ( res )
16+ return
1917 }
18+ controller . patchUpdate ( req , res , next )
2019 } )
2120 . all ( ( req , res , next ) => {
2221 res . statusMessage = 'Improper request method for updating, please use PATCH to alter existing keys on this object.'
You can’t perform that action at this time.
0 commit comments