Remove unused function

This commit is contained in:
Adria Navarro 2025-01-09 13:00:02 +01:00
parent 6f629a3e5b
commit 71c6480c1b
2 changed files with 2 additions and 7 deletions

View File

@ -93,7 +93,7 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
// Generates an error object from a string
const makeError = (
message: string,
url?: string,
url: string,
method?: HTTPMethod
): APIError => {
return {
@ -239,13 +239,9 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
patch: requestApiCall(HTTPMethod.PATCH),
delete: requestApiCall(HTTPMethod.DELETE),
put: requestApiCall(HTTPMethod.PUT),
error: (message: string) => {
throw makeError(message)
},
invalidateCache: () => {
cache = {}
},
// 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.
getAppID: (): string => {

View File

@ -86,14 +86,13 @@ export type BaseAPIClient = {
patch: <RequestT = null, ResponseT = void>(
params: APICallParams<RequestT, ResponseT>
) => Promise<ResponseT>
error: (message: string) => void
invalidateCache: () => void
getAppID: () => string
}
export type APIError = {
message?: string
url?: string
url: string
method?: HTTPMethod
json: any
status: number