not-node 6.5.9 → 6.5.10
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
|
@@ -13,8 +13,13 @@ const extractors = Object.freeze({
|
|
|
13
13
|
[ACTION_DATA_TYPES.SORTER]: (result, req, thisSchema) => {
|
|
14
14
|
result.sorter = notFilter.sorter.process(req, thisSchema);
|
|
15
15
|
},
|
|
16
|
-
[ACTION_DATA_TYPES.SEARCH]: (result, req, thisSchema) => {
|
|
17
|
-
result.search = notFilter.search.process(
|
|
16
|
+
[ACTION_DATA_TYPES.SEARCH]: (result, req, thisSchema, formOptions) => {
|
|
17
|
+
result.search = notFilter.search.process(
|
|
18
|
+
req,
|
|
19
|
+
thisSchema,
|
|
20
|
+
{},
|
|
21
|
+
formOptions
|
|
22
|
+
);
|
|
18
23
|
},
|
|
19
24
|
[ACTION_DATA_TYPES.FILTER]: (result, req, thisSchema) => {
|
|
20
25
|
result.filter = notFilter.filter.process(req, thisSchema);
|
|
@@ -44,13 +49,14 @@ module.exports = (form, req) => {
|
|
|
44
49
|
}
|
|
45
50
|
if (thisSchema) {
|
|
46
51
|
let result = {};
|
|
52
|
+
const formOptions = form.getExtractorsOptions();
|
|
47
53
|
const routeActionDataTypes = form.getActionDataDataTypes(req);
|
|
48
54
|
Object.values(ACTION_DATA_TYPES).forEach((dataType) => {
|
|
49
55
|
if (
|
|
50
56
|
routeActionDataTypes.includes(dataType) &&
|
|
51
57
|
Object.hasOwn(extractors, dataType)
|
|
52
58
|
) {
|
|
53
|
-
extractors[dataType](result, req, thisSchema);
|
|
59
|
+
extractors[dataType](result, req, thisSchema, formOptions);
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
|
package/src/form/form.js
CHANGED
|
@@ -13,6 +13,7 @@ module.exports = class ListAndCountAction {
|
|
|
13
13
|
const result = await logic
|
|
14
14
|
.getModel()
|
|
15
15
|
.listAndCount(skip, size, sorter, filter, search, populate);
|
|
16
|
+
result.list = result.list.map((item) => item.toObject());
|
|
16
17
|
logic.logAction(actionName, identity, {});
|
|
17
18
|
return result;
|
|
18
19
|
} catch (e) {
|