( endpoint: T, params: GetAPIParams[T] )
| 133 | * @param json - Possible JSON body of the request. |
| 134 | */ |
| 135 | export function get<T extends keyof GetAPIReturns>( |
| 136 | endpoint: T, |
| 137 | params: GetAPIParams[T] |
| 138 | ): Promise<GetAPIReturns[T]> { |
| 139 | const url = apiUrl(endpoint, params); |
| 140 | return fetchJSON(url, "GET") as Promise<GetAPIReturns[T]>; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Execute a POST api request. |
no test coverage detected