Skip to content

Commit

Permalink
Fix error when reading the AOI and Watchlist response format
Browse files Browse the repository at this point in the history
  • Loading branch information
willemarcel committed Jan 18, 2024
1 parent e2ea1a2 commit 0e9dea8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/network/aoi.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ export function fetchAllAOIs(token?: string): Promise<*> {
}
})
.then(handleErrors)
.then(res => {
return res.json();
});
.then(res => res.json())
.then(res => res.results);
}

export function updateAOI(
Expand Down
5 changes: 2 additions & 3 deletions src/network/osmcha_watchlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ export function fetchWatchList(token: string): Promise<*> {
}
})
.then(handleErrors)
.then(res => {
return res.json();
});
.then(res => res.json())
.then(res => res.results);
}

export function deleteFromWatchList(token: string, uid: string): Promise<*> {
Expand Down

0 comments on commit 0e9dea8

Please sign in to comment.