Skip to content

Commit

Permalink
Mark jsonGet and jsonPost as returning unknown
Browse files Browse the repository at this point in the history
This forces us to parse / validate every response.
  • Loading branch information
shepmaster committed Dec 1, 2023
1 parent 1828325 commit 04051ca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/frontend/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ export const reExecuteWithBacktrace = (): ThunkAction => dispatch => {

type FetchArg = Parameters<typeof fetch>[0];

export function jsonGet(url: FetchArg) {
export function jsonGet(url: FetchArg): Promise<unknown> {
return fetchJson(url, {
method: 'get',
});
}

export function jsonPost<T>(url: FetchArg, body: Record<string, any>): Promise<T> {
export function jsonPost(url: FetchArg, body: Record<string, any>): Promise<unknown> {
return fetchJson(url, {
method: 'post',
body: JSON.stringify(body),
Expand Down

0 comments on commit 04051ca

Please sign in to comment.