Skip to content

Commit

Permalink
Tighten up generic typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesobrooks committed Sep 19, 2024
1 parent 521ada6 commit 4738441
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions user-interface/src/lib/models/api2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ export function useGenericApi(): GenericApiClient {
const body = await api.get(uriOrPathSubstring, options);
return body as ResponseBody<T>;
},
async patch<T extends object = object>(
async patch<T extends object = object, U extends object = object>(
path: string,
body: object,
body: U,
options?: ObjectKeyVal,
): Promise<ResponseBody<T> | void> {
const { uriOrPathSubstring, queryParams } = justThePath(path);
Expand All @@ -135,9 +135,9 @@ export function useGenericApi(): GenericApiClient {
}
return responseBody as ResponseBody<T>;
},
async post<T extends object = object>(
async post<T extends object = object, U extends object = object>(
path: string,
body: object,
body: U,
options?: ObjectKeyVal,
): Promise<ResponseBody<T> | void> {
const { uriOrPathSubstring, queryParams } = justThePath(path);
Expand Down

0 comments on commit 4738441

Please sign in to comment.