Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Get rid of ugly query building in JS

dominik-zeglenbb97af5f81f0
diff --git a/saleor/static/dashboard/js/components/misc.js b/saleor/static/dashboard/js/components/misc.js
index e6127e7375..d2964b770d 100644
--- a/saleor/static/dashboard/js/components/misc.js
+++ b/saleor/static/dashboard/js/components/misc.js
@@ -38,11 +38,6 @@ export default $(document).ready((e) => {
}
return 1;
});
-
- $('.js-build-query').each((i, chip) => {
- const $chip = $(chip);
- $chip.attr('href', window.location.pathname.split('?')[0] + '?' + removeFromQuery($chip.attr('data-name'), $chip.attr('data-value')));
- });
});
export const screenSizes = {
diff --git a/templates/dashboard/includes/_filters.html b/templates/dashboard/includes/_filters.html
index 3f0c37f82c..ef0212a4d2 100644
--- a/templates/dashboard/includes/_filters.html
+++ b/templates/dashboard/includes/_filters.html
@@ -13,7 +13,7 @@
</div>
<div class="col s12 hide-on-large-only chips-container">
{% for chip in chips %}
- <div class="chip">{{ chip.content|safe }} <a class="js-build-query" data-name="{{ chip.name }}" data-value="{{ chip.value }}">×</a></div>
+ <div class="chip">{{ chip.content|safe }} <a href="{{ chip.link }}">×</a></div>
{% endfor %}
</div>
<div class="clearfix"></div>