Skip to content

Commit

Permalink
db, req, res: now are sent as individual parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
pomgui committed Sep 7, 2020
1 parent 8d25901 commit 3ad6e16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/service/PiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function decorator(path: string, defineRoute: IRouterMatcher<void>, options?: Pi
let result: any;
return Promise.resolve()
.then(() => db.beginTransaction())
.then(() => orig.call(target, normalizeQueryParams(req, desc), { db, req, res }))
.then(() => orig.call(target, normalizeQueryParams(req, desc), db, req, res))
.then(r => result = r)
.then(() => db.commit())
.then(() => options!.customSend || res.send(result))
Expand All @@ -34,7 +34,7 @@ function decorator(path: string, defineRoute: IRouterMatcher<void>, options?: Pi
.catch(error => options!.errorHandler!({ db: null, req, res, error }));
} else
return Promise.resolve()
.then(() => orig.call(target, normalizeQueryParams(req, desc), { db, req, res }))
.then(() => orig.call(target, normalizeQueryParams(req, desc), db, req, res))
.then(result => options!.customSend || res.send(result))
.catch(error => options!.errorHandler!({ db: null, req, res, error }));
};
Expand Down

0 comments on commit 3ad6e16

Please sign in to comment.