Receive a JSON from Apex, parse into an object and access it's information on Javascript

PHOTO EMBED

Mon Jun 27 2022 18:40:09 GMT+0000 (UTC)

Saved by @gbritgs #javascript #lwc #salesforce #apex

@wire(callout2Apex,{id: this.recordId})
faturaAbertaWired({ error, data }) {
  if (data) {
    this.arr = JSON.parse(data).keyFromJSON;
    this.loaded = true;
  } else if (error) {
    this.loaded = false;
  };
}
content_copyCOPY

An easy and quick way to parse objects without having to create DTO classes