I am passing data from the flow to the lwc component, making a copy of it and then adding a new key-value pair to each item in the array. The below code does not produce any errors but it doesn't work as expected.I have read that a direct copy and modification of the data from an api variable is not possible and that is why I tried using JSON.parse below.
@api availablePartsList;
data = [];
connectedCallback() {
this.data = [...this.availablePartsList];
this.data.forEach((part) => {
part.IsReplace = false;
});
}