Skip to content

Commit

Permalink
NEXT-15827 - fixed broken search in sw-promotion-v2-sales-channel-sel…
Browse files Browse the repository at this point in the history
…ect.html.twig
  • Loading branch information
celha authored and MartinKrzykawski committed Oct 21, 2021
1 parent edfb14b commit d12cd43
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Fixed broken search in sw-promotion-v2-sales-channel-select.html.twig
issue: NEXT-15827
author: Marcel Hakvoort
author_email: [email protected]
author_github: @celha
---
# Administration
* Fixed the broken `sw-multi-select` search in the `sw-promotion-v2-sales-channel-select.html.twig` component
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Component.register('sw-promotion-v2-sales-channel-select', {
data() {
return {
salesChannels: [],
sortBy: 'name',
};
},

Expand Down Expand Up @@ -63,6 +64,13 @@ Component.register('sw-promotion-v2-sales-channel-select', {
this.handleWithRepository(deleted, added);
},
},

salesChannelCriteria() {
const salesChannelCriteria = new Criteria(1, 500);
salesChannelCriteria.addSorting(Criteria.sort(this.sortBy, this.sortDirection, this.naturalSorting));

return salesChannelCriteria;
},
},

created() {
Expand All @@ -72,7 +80,7 @@ Component.register('sw-promotion-v2-sales-channel-select', {
methods: {
createdComponent() {
this.salesChannelRepository
.search(new Criteria(1, 500))
.search(this.salesChannelCriteria)
.then(searchresult => {
this.salesChannels = searchresult;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
v-bind="$attrs"
:options="salesChannels"
value-property="id"
label-property="name"
>

{% block sw_promotion_v2_sales_channel_selection_label %}
Expand Down

0 comments on commit d12cd43

Please sign in to comment.