Skip to content

Commit

Permalink
renamed Middleware to be more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuevIO committed Sep 14, 2024
1 parent b0944dc commit 62b1dcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { recordError } from '@/utils/errorHandler';
import { createClient } from '@profcomff/api-uilib';
import { type Middleware } from 'openapi-fetch';

const responseMiddleware: Middleware = {
const errorMiddleware: Middleware = {
async onResponse({ response }) {
const data = await response.clone();
if (!response.ok) {
Expand All @@ -16,5 +16,5 @@ const responseMiddleware: Middleware = {
};

const apiClient = createClient(import.meta.env.VITE_API_URL);
apiClient.use(responseMiddleware);
apiClient.use(errorMiddleware);
export default apiClient;

0 comments on commit 62b1dcb

Please sign in to comment.