fix: compatability with old querybuilder objects
This commit is contained in:
parent
f7353fb164
commit
013cb9f95d
1 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ export default abstract class DynamicQueryBuilder {
|
||||||
count?: number;
|
count?: number;
|
||||||
noLimit?: boolean;
|
noLimit?: boolean;
|
||||||
}): SelectQueryBuilder<ObjectLiteral> {
|
}): SelectQueryBuilder<ObjectLiteral> {
|
||||||
let affix = queryObj.id.replaceAll("-", "") ?? StringHelper.random(10);
|
let affix = queryObj.id?.replaceAll("-", "") ?? StringHelper.random(10);
|
||||||
let query = dataSource.getRepository(queryObj.table).createQueryBuilder(`${affix}_${queryObj.table}`);
|
let query = dataSource.getRepository(queryObj.table).createQueryBuilder(`${affix}_${queryObj.table}`);
|
||||||
|
|
||||||
this.buildDynamicQuery(query, queryObj, affix);
|
this.buildDynamicQuery(query, queryObj, affix);
|
||||||
|
@ -118,7 +118,7 @@ export default abstract class DynamicQueryBuilder {
|
||||||
|
|
||||||
if (queryObject.join) {
|
if (queryObject.join) {
|
||||||
for (const join of queryObject.join) {
|
for (const join of queryObject.join) {
|
||||||
let subaffix = join.id.replaceAll("-", "") ?? StringHelper.random(10);
|
let subaffix = join.id?.replaceAll("-", "") ?? StringHelper.random(10);
|
||||||
if (join.type == undefined) join.type = "defined";
|
if (join.type == undefined) join.type = "defined";
|
||||||
if (join.type == "defined") {
|
if (join.type == "defined") {
|
||||||
query.innerJoin(`${alias}.${join.foreignColumn}`, `${subaffix}_${join.table}`);
|
query.innerJoin(`${alias}.${join.foreignColumn}`, `${subaffix}_${join.table}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue