Skip to content

Commit

Permalink
Apply fixes from Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
royduin authored and actions-user committed Jan 22, 2025
1 parent bce2dc8 commit 9fdcf99
Showing 1 changed file with 31 additions and 23 deletions.
54 changes: 31 additions & 23 deletions resources/js/components/Listing/Listing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ export default {
sorting: this.sortOptions.reduce((acc, item) => {
acc[item.key] = {
field: item.field,
order: item.order
};
return acc;
order: item.order,
}
return acc
}),
},
})
Expand Down Expand Up @@ -163,26 +163,34 @@ export default {
},
sortOptions: function () {
return [{
label: window.config.translations.relevance,
field: '_score',
order: 'desc',
value: config.index,
key: 'default',
}].concat(this.sortings.flatMap(function (sorting) {
return [
['asc', window.config.translations.asc],
['desc', window.config.translations.desc],
].map(function ([directionKey, directionLabel]) {
return {
label: window.config.translations.sorting?.[sorting.code]?.[directionKey] ?? sorting.name + ' ' + directionLabel,
field: sorting.code + (sorting.code != 'price' ? '.keyword' : ''),
order: directionKey,
value: [config.index, sorting.code, directionKey].join('_'),
key: '_'+[sorting.code, directionKey].join('_')
}
})
})).concat(this.additionalSorting)
return [
{
label: window.config.translations.relevance,
field: '_score',
order: 'desc',
value: config.index,
key: 'default',
},
]
.concat(
this.sortings.flatMap(function (sorting) {
return [
['asc', window.config.translations.asc],
['desc', window.config.translations.desc],
].map(function ([directionKey, directionLabel]) {
return {
label:
window.config.translations.sorting?.[sorting.code]?.[directionKey] ??
sorting.name + ' ' + directionLabel,
field: sorting.code + (sorting.code != 'price' ? '.keyword' : ''),
order: directionKey,
value: [config.index, sorting.code, directionKey].join('_'),
key: '_' + [sorting.code, directionKey].join('_'),
}
})
}),
)
.concat(this.additionalSorting)
},
},
Expand Down

0 comments on commit 9fdcf99

Please sign in to comment.