Self hosted FLOSS fitness/workout, nutrition and weight tracker
No need to transform the AJAX response
Peter van der Doesd682133c3472
diff --git a/wger/exercises/templates/equipment/overview.html b/wger/exercises/templates/equipment/overview.htmlindex a0cb77e6e..2d217f3af 100644--- a/wger/exercises/templates/equipment/overview.html+++ b/wger/exercises/templates/equipment/overview.html@@ -15,26 +15,14 @@<script>$(function() {// Init the autocompleter- $('#exercise-search').devbridgeAutocomplete({+ $('#exercise-search').autocomplete({showNoSuggestionNotice: true,serviceUrl: '{% url 'exercise-search' %}',onSelect: function (suggestion) {window.location.href = '/exercise/' + suggestion.data.id + '/view/'},groupBy: 'category',- paramName: 'term',- transformResult: function(response) {- // why is response not already a JSON object??- var jsonResponse = $.parseJSON(response);- return {- suggestions: $.map(jsonResponse, function(item) {- return {value: item.value, data: {id: item.id,- category: item.category,- image: item.image,- thumbnail: item.image_thumbnail}};- })- };- }+ paramName: 'term'});});</script>