@@ -117,7 +117,7 @@ function historyGet (req, res) {
117117 if ( req . isAuthenticated ( ) ) {
118118 getHistory ( req . user . id , function ( err , history ) {
119119 if ( err ) return response . errorInternalError ( res )
120- if ( ! history ) return response . errorNotFound ( res )
120+ if ( ! history ) return response . errorNotFound ( req , res )
121121 res . send ( {
122122 history : parseHistoryToArray ( history )
123123 } )
@@ -150,8 +150,8 @@ function historyPost (req, res) {
150150 if ( typeof req . body [ 'pinned' ] === 'undefined' ) return response . errorBadRequest ( res )
151151 getHistory ( req . user . id , function ( err , history ) {
152152 if ( err ) return response . errorInternalError ( res )
153- if ( ! history ) return response . errorNotFound ( res )
154- if ( ! history [ noteId ] ) return response . errorNotFound ( res )
153+ if ( ! history ) return response . errorNotFound ( req , res )
154+ if ( ! history [ noteId ] ) return response . errorNotFound ( req , res )
155155 if ( req . body . pinned === 'true' || req . body . pinned === 'false' ) {
156156 history [ noteId ] . pinned = ( req . body . pinned === 'true' )
157157 setHistory ( req . user . id , history , function ( err , count ) {
@@ -179,7 +179,7 @@ function historyDelete (req, res) {
179179 } else {
180180 getHistory ( req . user . id , function ( err , history ) {
181181 if ( err ) return response . errorInternalError ( res )
182- if ( ! history ) return response . errorNotFound ( res )
182+ if ( ! history ) return response . errorNotFound ( req , res )
183183 delete history [ noteId ]
184184 setHistory ( req . user . id , history , function ( err , count ) {
185185 if ( err ) return response . errorInternalError ( res )
0 commit comments