Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic sorting #1522

Open
AnburajanR opened this issue Oct 5, 2024 · 1 comment
Open

Dynamic sorting #1522

AnburajanR opened this issue Oct 5, 2024 · 1 comment

Comments

@AnburajanR
Copy link

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

@AnburajanR
Copy link
Author

I need help from everyone to fix the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant