Skip to content

Dynamic sorting #1522

@AnburajanR

Description

@AnburajanR

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions