Skip to content

Commit 84302d1

Browse files
authored
feat: users can now use flattened fields with custom routes
1 parent 3648048 commit 84302d1

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports.RecordCreator = Interface.RecordCreator;
2323
exports.RecordRemover = Interface.RecordRemover;
2424
exports.RecordsRemover = Interface.RecordsRemover;
2525
exports.RecordSerializer = Interface.RecordSerializer;
26+
exports.requestUnflattener = Flattener.requestUnflattener;
2627

2728
exports.PUBLIC_ROUTES = Interface.PUBLIC_ROUTES;
2829

test/tests/index.test.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ const forestExpressMongoose = require('../../src/index');
22

33
describe('index', () => {
44
describe('exported Interface', () => {
5+
it('should export the request unflattener', () => {
6+
expect.assertions(2);
7+
8+
expect(forestExpressMongoose.requestUnflattener).toBeDefined();
9+
expect(forestExpressMongoose.requestUnflattener).toBeInstanceOf(Function);
10+
});
11+
512
it('should export a collection function', () => {
613
expect.assertions(2);
714

types/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,5 @@ export interface CollectionOptions {
332332
export function collection(name: string, options: CollectionOptions): void;
333333

334334
export function errorHandler(): RequestHandler;
335+
336+
export function requestUnflattener(): RequestHandler;

0 commit comments

Comments
 (0)