Open AnburajanR opened 1 month ago
const res = await this.supplierMapModel.findAndCountAll({ limit: size, offset: page * size, where: supplierMapWhereCondition, order: [[sortBy, sortOrder]], include: [ { model: Supplier, where: supplierWhereCondition, include: [ { model: SupplierContact }, { model: ShadowLocationType }, { model: ShadowCriticality }, { model: ShadowRegion }, { model: ShadowCountry }, { model: ShadowTimeZone }, { model: ShadowInviteDetail}, {model: ShadowSupplierRiskSignal}, {model: ShadowSupplierRiskSummary } ] } ] });
sortBy = {contact_name,location_type_name,region_name,country_name} sortOrder = "ASC" SortBy comes with dynamic one-field sorting Include we need without aliases
I need help from everyone to fix the issue
const res = await this.supplierMapModel.findAndCountAll({ limit: size, offset: page * size, where: supplierMapWhereCondition, order: [[sortBy, sortOrder]], include: [ { model: Supplier, where: supplierWhereCondition, include: [ { model: SupplierContact }, { model: ShadowLocationType }, { model: ShadowCriticality }, { model: ShadowRegion }, { model: ShadowCountry }, { model: ShadowTimeZone }, { model: ShadowInviteDetail}, {model: ShadowSupplierRiskSignal}, {model: ShadowSupplierRiskSummary } ] } ] });
sortBy = {contact_name,location_type_name,region_name,country_name} sortOrder = "ASC" SortBy comes with dynamic one-field sorting Include we need without aliases