Skip to content

Commit 103027d

Browse files
authored
Merge pull request #2487 from visualize-admin/fix/profile-issues
fix: API parsing problems
2 parents 1cf8a76 + 6e4de89 commit 103027d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ You can also check the
1414
- Fix
1515
- Clicking on Y axis title in bar charts now open Data tab in the details
1616
panels, as in other chart types
17+
- Fixed parsing problems with API routes
1718

1819
### 6.1.2 - 2025-10-22
1920

app/utils/api.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export const apiFetch = async <T>(
2323
);
2424
const json = await res.json();
2525
if (json.success) {
26-
return json.data && "json" in json.data && "meta" in json.data
26+
return "data" in json &&
27+
typeof json.data === "object" &&
28+
json.data !== null &&
29+
"meta" in json.data
2730
? (SuperJSON.deserialize(json.data) as T)
2831
: (json.data as T);
2932
} else {

0 commit comments

Comments
 (0)