@ccci/micro-server 1.0.173 → 1.0.174
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/dist/index.js +2 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -297652,22 +297652,18 @@ function ConstructQuery(query) {
|
|
|
297652
297652
|
let includes = [];
|
|
297653
297653
|
let toplevel = data.filter((el) => el.indexOf(".") == -1);
|
|
297654
297654
|
toplevel.forEach((top) => {
|
|
297655
|
-
let association = { association: top, required:
|
|
297655
|
+
let association = { association: top, required: false };
|
|
297656
297656
|
if (query.search) {
|
|
297657
297657
|
const queries = query.search.split(",");
|
|
297658
|
-
Logger.info(`queries: ${JSON.stringify(queries)}`);
|
|
297659
297658
|
let injectable = queries.find((q) => q.indexOf("$") > -1 && q.indexOf(top) > -1);
|
|
297660
|
-
Logger.info(`injectable: ${JSON.stringify(injectable)}`);
|
|
297661
297659
|
if (injectable) {
|
|
297662
297660
|
injectable = injectable.replaceAll("$", "");
|
|
297663
297661
|
let nested2 = injectable.split(".");
|
|
297664
|
-
Logger.info(`nested: ${JSON.stringify(nested2)}`);
|
|
297665
297662
|
let pair = nested2[1].split(":");
|
|
297666
|
-
Logger.info(`pair: ${JSON.stringify(pair)}`);
|
|
297667
297663
|
let associationkey = pair[0];
|
|
297668
|
-
Logger.info(`associationkey: ${JSON.stringify(associationkey)}`);
|
|
297669
297664
|
association.through = { where: {} };
|
|
297670
297665
|
association.through.where[associationkey] = pair[1];
|
|
297666
|
+
association.required = true;
|
|
297671
297667
|
Logger.info(`association.where: ${JSON.stringify(association)}`);
|
|
297672
297668
|
}
|
|
297673
297669
|
}
|