remult 0.20.0 → 0.20.1-exp.0
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.
|
@@ -23,10 +23,13 @@ export class RestDataProvider {
|
|
|
23
23
|
}
|
|
24
24
|
//@internal
|
|
25
25
|
export function findOptionsToJson(options, meta) {
|
|
26
|
-
|
|
26
|
+
const r = {
|
|
27
27
|
...options,
|
|
28
28
|
where: Filter.entityFilterToJson(meta, options.where),
|
|
29
29
|
};
|
|
30
|
+
if (options.load)
|
|
31
|
+
r.load = options.load(meta.fields).map(y => y.key);
|
|
32
|
+
return r;
|
|
30
33
|
}
|
|
31
34
|
//@internal
|
|
32
35
|
export function findOptionsFromJson(json, meta) {
|
|
@@ -40,6 +43,9 @@ export function findOptionsFromJson(json, meta) {
|
|
|
40
43
|
r[key] = json[key];
|
|
41
44
|
}
|
|
42
45
|
}
|
|
46
|
+
if (json.load) {
|
|
47
|
+
r.load = (z) => json.load.map(y => z.find(y));
|
|
48
|
+
}
|
|
43
49
|
return r;
|
|
44
50
|
}
|
|
45
51
|
export class RestEntityDataProvider {
|
package/package.json
CHANGED
|
@@ -35,7 +35,10 @@ var RestDataProvider = /** @class */ (function () {
|
|
|
35
35
|
exports.RestDataProvider = RestDataProvider;
|
|
36
36
|
//@internal
|
|
37
37
|
function findOptionsToJson(options, meta) {
|
|
38
|
-
|
|
38
|
+
var r = tslib_1.__assign(tslib_1.__assign({}, options), { where: filter_interfaces_1.Filter.entityFilterToJson(meta, options.where) });
|
|
39
|
+
if (options.load)
|
|
40
|
+
r.load = options.load(meta.fields).map(function (y) { return y.key; });
|
|
41
|
+
return r;
|
|
39
42
|
}
|
|
40
43
|
exports.findOptionsToJson = findOptionsToJson;
|
|
41
44
|
//@internal
|
|
@@ -61,6 +64,9 @@ function findOptionsFromJson(json, meta) {
|
|
|
61
64
|
}
|
|
62
65
|
finally { if (e_1) throw e_1.error; }
|
|
63
66
|
}
|
|
67
|
+
if (json.load) {
|
|
68
|
+
r.load = function (z) { return json.load.map(function (y) { return z.find(y); }); };
|
|
69
|
+
}
|
|
64
70
|
return r;
|
|
65
71
|
}
|
|
66
72
|
exports.findOptionsFromJson = findOptionsFromJson;
|