Dynamic sorting
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- databases
Research direction
Start with the Sequelize query shown in the issue and investigate how dynamic sortBy values interact with included models and aliases. Confirm the supported fields—contact_name, location_type_name, region_name, and country_name—and verify that ascending sorting works for each before considering the work done.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- JavaScript
- Stars
- 2.6k
- Forks
- 524
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequelize/cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·