Portfolio/frontend/src/api/index.ts
2022-12-04 21:29:09 +01:00

13 lines
No EOL
291 B
TypeScript

import { goto } from "$app/navigation";
import type { AxiosError } from "axios";
export const API_URL = "http://localhost:8000";
export interface ApiError {
error: AxiosError,
msg: string,
}
export function errorHandler(error: AxiosError, msg: string): ApiError {
return {error, msg}
}