namirasoft-field-node 1.4.36 → 1.4.37
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Includeable
|
|
1
|
+
import { Includeable } from "sequelize";
|
|
2
2
|
import { NSFTables } from "../database/NSFTables";
|
|
3
3
|
import { BaseMySqlDatabase } from "namirasoft-node-mysql";
|
|
4
4
|
import { BaseDatabase_FilterTable } from "namirasoft-node";
|
|
@@ -8,7 +8,5 @@ export declare class NSFListController {
|
|
|
8
8
|
}): {
|
|
9
9
|
[table: string]: BaseDatabase_FilterTable;
|
|
10
10
|
};
|
|
11
|
-
static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[],
|
|
12
|
-
[table: string]: WhereOptions[];
|
|
13
|
-
}, tables: NSFTables<D>): Includeable[];
|
|
11
|
+
static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[], joins: string[], tables: NSFTables<D>): Includeable[];
|
|
14
12
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NSFListController = void 0;
|
|
4
|
-
const sequelize_1 = require("sequelize");
|
|
5
4
|
const NamirasoftFieldUUIDShort_1 = require("../NamirasoftFieldUUIDShort");
|
|
6
5
|
const namirasoft_core_1 = require("namirasoft-core");
|
|
7
6
|
class NSFListController {
|
|
@@ -56,25 +55,22 @@ class NSFListController {
|
|
|
56
55
|
};
|
|
57
56
|
return ans;
|
|
58
57
|
}
|
|
59
|
-
static handle_getIncludes(name, includes,
|
|
58
|
+
static handle_getIncludes(name, includes, joins, tables) {
|
|
60
59
|
let ans = [...includes];
|
|
61
|
-
if (
|
|
60
|
+
if (joins.includes(`${name}_category`))
|
|
62
61
|
ans.push({
|
|
63
62
|
model: tables.entity_category.model,
|
|
64
63
|
attributes: [],
|
|
65
|
-
where: { [sequelize_1.Op.and]: conditions[`${name}_category`] }
|
|
66
64
|
});
|
|
67
|
-
if (
|
|
65
|
+
if (joins.includes(`${name}_field`))
|
|
68
66
|
ans.push({
|
|
69
67
|
model: tables.entity_field.model,
|
|
70
68
|
attributes: [],
|
|
71
|
-
where: { [sequelize_1.Op.and]: conditions[`${name}_field`] }
|
|
72
69
|
});
|
|
73
|
-
if (
|
|
70
|
+
if (joins.includes(`${name}_tag`))
|
|
74
71
|
ans.push({
|
|
75
72
|
model: tables.entity_tag.model,
|
|
76
73
|
attributes: [],
|
|
77
|
-
where: { [sequelize_1.Op.and]: conditions[`${name}_tag`] }
|
|
78
74
|
});
|
|
79
75
|
return ans;
|
|
80
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NSFListController.js","sourceRoot":"","sources":["../../src/controller/NSFListController.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"NSFListController.js","sourceRoot":"","sources":["../../src/controller/NSFListController.ts"],"names":[],"mappings":";;;AAIA,0EAAuE;AACvE,qDAA2C;AAE3C,MAAa,iBAAiB;IAE1B,MAAM,CAAC,gBAAgB,CAAC,IAAY,EAAE,MAAsD;QAExF,IAAI,GAAG,qBAAQ,MAAM,CAAE,CAAC;QACxB,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACf,GAAG,CAAC,GAAG,IAAI,WAAW,CAAC,GAAG;YACtB,eAAe,EAAE;gBACb,IAAI,EAAE;oBACF,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;iBACf;gBACD,SAAS,EAAE;oBACP,KAAK,EAAE,GAAG,IAAI,WAAW;oBACzB,MAAM,EAAE,WAAW;iBACtB;aACJ;SACJ,CAAC;QACF,GAAG,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG;YACnB,eAAe,EAAE;gBACb,IAAI,EAAE;oBACF,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,IAAI;iBACf;gBACD,SAAS,EAAE;o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EAAE,EAAE;aAEjB,CAAC,CAAC;QACP,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAI,MAAM,CAAC;YAC7B,GAAG,CAAC,IAAI,CAAC;gBACL,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,KAAK;gBAC9B,UAAU,EAAE,EAAE;aAEjB,CAAC,CAAC;QACP,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA/ED,8CA+EC"}
|
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Includeable, WhereOptions } from "sequelize";
|
|
1
|
+
import { Includeable } from "sequelize";
|
|
3
2
|
import { NSFTables } from "../database/NSFTables";
|
|
4
3
|
import { BaseMySqlDatabase } from "namirasoft-node-mysql";
|
|
5
4
|
import { BaseDatabase_FilterTable } from "namirasoft-node";
|
|
@@ -62,26 +61,26 @@ export class NSFListController
|
|
|
62
61
|
};
|
|
63
62
|
return ans;
|
|
64
63
|
}
|
|
65
|
-
static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[],
|
|
64
|
+
static handle_getIncludes<D extends BaseMySqlDatabase>(name: string, includes: Includeable[], joins: string[], tables: NSFTables<D>): Includeable[]
|
|
66
65
|
{
|
|
67
66
|
let ans = [...includes];
|
|
68
|
-
if (
|
|
67
|
+
if (joins.includes(`${name}_category`))
|
|
69
68
|
ans.push({
|
|
70
69
|
model: tables.entity_category.model,
|
|
71
70
|
attributes: [],
|
|
72
|
-
where: { [Op.and]: conditions[`${name}_category`] }
|
|
71
|
+
// where: { [Op.and]: conditions[`${name}_category`] }
|
|
73
72
|
});
|
|
74
|
-
if (
|
|
73
|
+
if (joins.includes(`${name}_field`))
|
|
75
74
|
ans.push({
|
|
76
75
|
model: tables.entity_field.model,
|
|
77
76
|
attributes: [],
|
|
78
|
-
where: { [Op.and]: conditions[`${name}_field`] }
|
|
77
|
+
// where: { [Op.and]: conditions[`${name}_field`] }
|
|
79
78
|
});
|
|
80
|
-
if (
|
|
79
|
+
if (joins.includes(`${name}_tag`))
|
|
81
80
|
ans.push({
|
|
82
81
|
model: tables.entity_tag.model,
|
|
83
82
|
attributes: [],
|
|
84
|
-
where: { [Op.and]: conditions[`${name}_tag`] }
|
|
83
|
+
// where: { [Op.and]: conditions[`${name}_tag`] }
|
|
85
84
|
});
|
|
86
85
|
return ans;
|
|
87
86
|
}
|