Remove unused function
This commit is contained in:
parent
6f629a3e5b
commit
71c6480c1b
|
@ -93,7 +93,7 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
|
||||||
// Generates an error object from a string
|
// Generates an error object from a string
|
||||||
const makeError = (
|
const makeError = (
|
||||||
message: string,
|
message: string,
|
||||||
url?: string,
|
url: string,
|
||||||
method?: HTTPMethod
|
method?: HTTPMethod
|
||||||
): APIError => {
|
): APIError => {
|
||||||
return {
|
return {
|
||||||
|
@ -239,13 +239,9 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
|
||||||
patch: requestApiCall(HTTPMethod.PATCH),
|
patch: requestApiCall(HTTPMethod.PATCH),
|
||||||
delete: requestApiCall(HTTPMethod.DELETE),
|
delete: requestApiCall(HTTPMethod.DELETE),
|
||||||
put: requestApiCall(HTTPMethod.PUT),
|
put: requestApiCall(HTTPMethod.PUT),
|
||||||
error: (message: string) => {
|
|
||||||
throw makeError(message)
|
|
||||||
},
|
|
||||||
invalidateCache: () => {
|
invalidateCache: () => {
|
||||||
cache = {}
|
cache = {}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Generic utility to extract the current app ID. Assumes that any client
|
// Generic utility to extract the current app ID. Assumes that any client
|
||||||
// that exists in an app context will be attaching our app ID header.
|
// that exists in an app context will be attaching our app ID header.
|
||||||
getAppID: (): string => {
|
getAppID: (): string => {
|
||||||
|
|
|
@ -86,14 +86,13 @@ export type BaseAPIClient = {
|
||||||
patch: <RequestT = null, ResponseT = void>(
|
patch: <RequestT = null, ResponseT = void>(
|
||||||
params: APICallParams<RequestT, ResponseT>
|
params: APICallParams<RequestT, ResponseT>
|
||||||
) => Promise<ResponseT>
|
) => Promise<ResponseT>
|
||||||
error: (message: string) => void
|
|
||||||
invalidateCache: () => void
|
invalidateCache: () => void
|
||||||
getAppID: () => string
|
getAppID: () => string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type APIError = {
|
export type APIError = {
|
||||||
message?: string
|
message?: string
|
||||||
url?: string
|
url: string
|
||||||
method?: HTTPMethod
|
method?: HTTPMethod
|
||||||
json: any
|
json: any
|
||||||
status: number
|
status: number
|
||||||
|
|
Loading…
Reference in New Issue