anote-server-libs 0.6.4 → 0.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anote-server-libs",
3
- "version": "0.6.4",
3
+ "version": "0.6.6",
4
4
  "description": "Helpers for express-TS servers",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -25,7 +25,7 @@
25
25
  "pg": "8.13.1"
26
26
  },
27
27
  "peerDependencies": {
28
- "express": "4.12.1",
28
+ "express": "4.21.1",
29
29
  "winston": "3.17.0"
30
30
  },
31
31
  "devDependencies": {
@@ -10,7 +10,7 @@ function withTransaction(repo, logger, previousMethod, lock, commitIfLost = true
10
10
  return function (req, res, next) {
11
11
  let commit = true;
12
12
  if (!commitIfLost) {
13
- req.once('close', () => commit = false);
13
+ res.once('close', () => commit = false);
14
14
  }
15
15
  const endTerminator = res.end.bind(res);
16
16
  const jsonTerminator = (obj) => {
@@ -17,7 +17,7 @@ export function withTransaction(repo: BaseModelRepository, logger: Logger, previ
17
17
  return function(req: Request, res: Response, next: NextFunction) {
18
18
  let commit = true;
19
19
  if(!commitIfLost) {
20
- req.once('close', () => commit = false);
20
+ res.once('close', () => commit = false);
21
21
  }
22
22
  const endTerminator = res.end.bind(res);
23
23
  const jsonTerminator = (obj: any) => {