Skip to content

Commit 04051ca

Browse files
committed
Mark jsonGet and jsonPost as returning unknown
This forces us to parse / validate every response.
1 parent 1828325 commit 04051ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/frontend/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,13 @@ export const reExecuteWithBacktrace = (): ThunkAction => dispatch => {
150150

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

153-
export function jsonGet(url: FetchArg) {
153+
export function jsonGet(url: FetchArg): Promise<unknown> {
154154
return fetchJson(url, {
155155
method: 'get',
156156
});
157157
}
158158

159-
export function jsonPost<T>(url: FetchArg, body: Record<string, any>): Promise<T> {
159+
export function jsonPost(url: FetchArg, body: Record<string, any>): Promise<unknown> {
160160
return fetchJson(url, {
161161
method: 'post',
162162
body: JSON.stringify(body),

0 commit comments

Comments
 (0)