MCPcopy
hub / github.com/appsmithorg/appsmith / get

Function get

app/client/src/api/core/api.ts:7–12  ·  view source on GitHub ↗
(...args: Parameters<typeof apiInstance.get>)

Source from the content-addressed store, hash-verified

5const apiInstance = apiFactory();
6
7export async function get<T>(...args: Parameters<typeof apiInstance.get>) {
8 // Note: we are passing AxiosResponseData as the second type argument to set the default type of the response data.The reason
9 // is we modify the response data in the responseSuccessInterceptor to return `.data` property from the axios response so that we can
10 // just `response.data` instead of `response.data.data`. So we have to make sure that the response data's type matches what we do in the interceptor.
11 return apiInstance.get<T, AxiosResponseData<T>>(...args);
12}
13
14export async function post<T>(...args: Parameters<typeof apiInstance.post>) {
15 return apiInstance.post<T, AxiosResponseData<T>>(...args);

Calls 1

getMethod · 0.65

Tested by

no test coverage detected