Skip to content

Commit 57149db

Browse files
author
marcelmoosbrugger
committed
refactoring
1 parent e2bfa52 commit 57149db

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

husky_components/datagrid/main.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,29 @@
720720
*/
721721
parseData: function(data) {
722722
this.data = {};
723-
this.data.links = data._links;
723+
this.data.links = this.parseLinks(data._links);
724724
this.data.embedded = data._embedded[this.options.resultKey];
725725
this.data.total = data.total;
726726
this.data.page = data.page;
727727
this.data.pages = data.pages;
728728
this.data.limit = data.limit;
729729
},
730730

731+
/**
732+
* Unescapes all passed links
733+
* @param links {Object}
734+
* @returns {Object}
735+
*/
736+
parseLinks: function(links) {
737+
var linksObj = {};
738+
this.sandbox.util.each(links, function(link, index) {
739+
linksObj[index] = {
740+
href: decodeURI(link.href)
741+
};
742+
}.bind(this));
743+
return linksObj;
744+
},
745+
731746
/**
732747
* Gets the view and starts the rendering of the data
733748
* @param viewId {String} the identifier of the decorator

0 commit comments

Comments
 (0)