1
0
Fork 0

remove unused file

This commit is contained in:
ChaotiCryptidz 2022-01-23 18:48:12 +00:00
parent 35663d94eb
commit 256465e05b

View file

@ -1,27 +0,0 @@
import { BaseAPIResponse } from "./types/api";
import { DoesNotExistError } from "../types/internalErrors";
import { settings } from "../globals/globalSettings";
export function getHeaders(): Record<string, string> {
return {
"X-Vault-Token": settings.token,
};
}
export const appendAPIURL = (url: string): string => settings.apiURL + url;
export async function checkResponse(resp: Response): Promise<void> {
if (resp.ok) return;
if (resp.status == 404) throw DoesNotExistError;
let json: BaseAPIResponse;
try {
json = (await resp.json()) as BaseAPIResponse;
} catch {
// Do Nothing
}
if (json?.errors?.length >= 1) {
throw new Error(json.errors[0]);
}
}