@@ -131,23 +131,23 @@ function historyPost (req, res) {
131131 if ( req . isAuthenticated ( ) ) {
132132 var noteId = req . params . noteId
133133 if ( ! noteId ) {
134- if ( typeof req . body [ 'history' ] === 'undefined' ) return response . errorBadRequest ( res )
134+ if ( typeof req . body [ 'history' ] === 'undefined' ) return response . errorBadRequest ( req , res )
135135 if ( config . debug ) { logger . info ( 'SERVER received history from [' + req . user . id + ']: ' + req . body . history ) }
136136 try {
137137 var history = JSON . parse ( req . body . history )
138138 } catch ( err ) {
139- return response . errorBadRequest ( res )
139+ return response . errorBadRequest ( req , res )
140140 }
141141 if ( Array . isArray ( history ) ) {
142142 setHistory ( req . user . id , history , function ( err , count ) {
143143 if ( err ) return response . errorInternalError ( res )
144144 res . end ( )
145145 } )
146146 } else {
147- return response . errorBadRequest ( res )
147+ return response . errorBadRequest ( req , res )
148148 }
149149 } else {
150- if ( typeof req . body [ 'pinned' ] === 'undefined' ) return response . errorBadRequest ( res )
150+ if ( typeof req . body [ 'pinned' ] === 'undefined' ) return response . errorBadRequest ( req , res )
151151 getHistory ( req . user . id , function ( err , history ) {
152152 if ( err ) return response . errorInternalError ( res )
153153 if ( ! history ) return response . errorNotFound ( req , res )
@@ -159,7 +159,7 @@ function historyPost (req, res) {
159159 res . end ( )
160160 } )
161161 } else {
162- return response . errorBadRequest ( res )
162+ return response . errorBadRequest ( req , res )
163163 }
164164 } )
165165 }
0 commit comments