I try to assign a new value (string + var) to a array field. I did a shallow copy, but still receive the mentioned error. Any idea what I'm doing wrong? Thx !!
import { LightningElement, wire } from 'lwc';
import initMethod from "@salesforce/apex/MCWrapperController.initMethod";
export default class Carousel extends LightningElement {
results;
@wire(initMethod, { cmsContentType: 'cms_image', cmsTopic: 'Home' })
getResults(response) {
const {data, error} = response;
if (data) {
arrCopy = [...data];
arrCopy.forEach(imgUrl => {
// I try to assign a string and a var, eg ... = "https://..." + {url}
imgUrl.contentNodes.source.url = "string" // for testing only string
});
this.results = arrCopy;
console.log ('cms', this.results);
} else if (error) {
// handle error
}
}
}