- ajax("/variants", "GET", res => {
- this.state.variants = res.variantArray;
+ fetch(
+ params.serverUrl + "/variants",
+ {method: "GET"},
+ )
+ .then(res => res.json())
+ .then(json => {
+ this.state.variants = json.variantArray.sort(
+ (v1,v2) => v1.name.localeCompare(v2.name));