Skip to content

Commit

Permalink
Solve issue with sortBy=use showing all products families instead of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
janwerkhoven committed Sep 26, 2023
1 parent 4717401 commit 30d2c41
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/pods/components/product-list/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ export default class ProductListComponent extends Component {
// For solder pastes
// For solder wires
// For solder alloys
if (groupBy === 'alloy') {
if (groupBy === 'use') {
const uses = products.mapBy('uses').flat().uniqBy('id').sortBy('rank');

return uses.map((use) => {
const subset = use.get('productsByRank');
const subset = use.get('productsByRank').filter((p) => {
return products.findBy('id', p.get('id'));
});
const title = this.translation.t(
use.get('forLabel'),
'products.16',
Expand Down
2 changes: 1 addition & 1 deletion app/pods/products/family/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class ProductsFamilyController extends Controller {
id === 'solder-wires' ||
id === 'solder-alloys'
) {
return 'alloy';
return 'use';
}

if (id === 'fluxing-systems') {
Expand Down

0 comments on commit 30d2c41

Please sign in to comment.