This commit is contained in:
Muhammad Rayhan Ardiansyah
2026-03-11 14:53:20 +07:00
parent 5bae9e56f1
commit a40161584e
5 changed files with 10 additions and 10 deletions

View File

@ -4,7 +4,7 @@ import { OrmHelper } from "../helpers/orm";
import { FactoryToSupplier } from "entity";
export class FactoryToSupplierModel {
static async listFactorybySupplier(supplier_id: string, filter = {}): Promise<SelectQueryBuilder<any>> {
static async list(filter = {}): Promise<SelectQueryBuilder<any>> {
const repo = OrmHelper.DB.getRepository(FactoryToSupplier);
let whereAttr: string[] = [];
let whereVal: any = {};
@ -16,7 +16,6 @@ export class FactoryToSupplierModel {
var query = repo.createQueryBuilder("factory_to_supplier")
.leftJoinAndSelect("factory_to_supplier.factory", "factory")
.leftJoinAndSelect("factory_to_supplier.supplier", "supplier")
.where("factory_to_supplier.supplier_id = :supplierId", { supplierId: supplier_id });
if (whereAttr.length != 0) {
query = query.where(whereAttr.join(" and "), whereVal);
}