Commit 1e60a265 authored by nanahira's avatar nanahira

fix

parent 97c94e49
Pipeline #7154 passed with stages
in 1 minute and 22 seconds
......@@ -73,16 +73,17 @@ export class CrudBase<
}
protected get entityAliasName() {
return `${camelCase(this.entityName)}_0`;
return camelCase(this.entityName);
}
protected applyRelationToQuery(qb: SelectQueryBuilder<T>, relation: string) {
const relationUnit = relation.split('.');
const base =
relationUnit.length === 1
? this.entityAliasName
: `${relationUnit[relationUnit.length - 2]}_${relationUnit.length - 1}`;
: relationUnit.slice(0, relationUnit.length - 1).join('_');
const property = relationUnit[relationUnit.length - 1];
const properyAlias = `${property}_${relationUnit.length}`;
const properyAlias = relationUnit.join('_');
qb.leftJoinAndSelect(`${base}.${property}`, properyAlias);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment