I need help! According to this post (https://developer.salesforce.com/blogs/2019/11/content-delivery-api-to-extend-or-integrate-content.html)I managed to receive content from our CMS.
Now I would like to sort the received in the JS controller, I therefore created a contentNode "sortnumber".
This is the JS adapter - any ideas?
import { LightningElement, wire } from "lwc";
import initMethod from "@salesforce/apex/MCWrapperController.initMethod";
export default class tripItinerary extends LightningElement {
@wire(initMethod) results;
/* my custom function, will use it later */
get jsonData() {
console.log('results', this.results.data); //is working fine I get all the data
// test 1: failed
//const result = JSON.parse(JSON.stringify(this.results));
//result.data.sort();
// test 2: failed
// const result = this.results.data;
// result.sort(function (a, b) {
// return a.data.contentNodes.sortnumber.value - b.data.contentNodes.sortnumber.value;
// });
return this.results;
}
}
The problem is, that I get no access to a sortable array!!
Thank you in advance!!