Skip to content

Commit 54f9b4e

Browse files
authored
feat(count): add middleware to deactivate count (#902)
1 parent 2e9fb1a commit 54f9b4e

File tree

5 files changed

+2710
-4239
lines changed

5 files changed

+2710
-4239
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"@babel/runtime": "7.15.4",
2929
"bluebird": "2.9.25",
3030
"core-js": "3.6.5",
31-
"forest-express": "9.3.2",
31+
"forest-express": "9.4.0",
3232
"http-errors": "1.6.1",
3333
"lodash": "4.17.21",
3434
"moment": "2.19.4",

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ exports.Schemas = Interface.Schemas;
4040
exports.ResourcesRoute = Interface.ResourcesRoute;
4141

4242
exports.PermissionMiddlewareCreator = Interface.PermissionMiddlewareCreator;
43+
exports.deactivateCountMiddleware = Interface.deactivateCountMiddleware;
4344
exports.RecordsCounter = Interface.RecordsCounter;
4445
exports.RecordsExporter = Interface.RecordsExporter;
4546
exports.RecordsGetter = Interface.RecordsGetter;

test/index.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ describe('index', () => {
99
expect(forestExpressSequelize.collection).toBeInstanceOf(Function);
1010
});
1111

12+
it('should export Optional Middleware functions', () => {
13+
expect.assertions(2);
14+
15+
expect(forestExpressSequelize.deactivateCountMiddleware).toBeDefined();
16+
expect(forestExpressSequelize.deactivateCountMiddleware).toBeInstanceOf(Function);
17+
});
18+
1219
it('should export an errorHandler middleware', () => {
1320
expect.assertions(2);
1421

types/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ export class PermissionMiddlewareCreator {
161161
smartAction(): RequestHandler;
162162
}
163163

164+
// Optional middleware(s) related to the perf
165+
166+
export function deactivateCountMiddleware(request: Request, response: Response, next: NextFunction): void;
167+
164168
// Everything related to Forest Charts
165169

166170
export interface StatSerialized {

0 commit comments

Comments
 (0)