Skip to content

Commit

Permalink
Merge pull request #45 from sajalverma17/fix/pick-top-level-json-vari…
Browse files Browse the repository at this point in the history
…ables

update(fix): Pick top-level json values from response's json object
  • Loading branch information
Rooyca authored Jan 24, 2025
2 parents c44975b + d690544 commit 7b08891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,8 @@ class ShowOutputModal extends Modal {
};

const parseAndCreate = (data: object) => (key: string) => {
const value = DataResponse.includes("->") ? nestedValue(data, key) : data[key];
contentEl.createEl('b', { text: key + " : " + JSON.stringify(value, null, 2) });
const value = DataResponse.includes("->") ? nestedValue(data, key) : data.json?.[key];
contentEl.createEl('b', { text: `${key} : ${JSON.stringify(value, null, 2)}` });
};

const requestOptions = {
Expand Down

0 comments on commit 7b08891

Please sign in to comment.