From 62b1dcb99c3d008aa612f8d839161dbf847391e3 Mon Sep 17 00:00:00 2001 From: default Date: Sat, 14 Sep 2024 22:07:26 +0000 Subject: [PATCH] renamed Middleware to be more clear --- src/api/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index cf6c3ad5..99b46089 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -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) { @@ -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;