From 219f12c2b2b973dd9321d7fd8dd7ca2971e65f8a Mon Sep 17 00:00:00 2001 From: Mehdi104797 <92753457+Mehdi104797@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:27:09 +0330 Subject: [PATCH] . --- plugins/httpService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/httpService.ts b/plugins/httpService.ts index d5c15a2..941a305 100644 --- a/plugins/httpService.ts +++ b/plugins/httpService.ts @@ -8,8 +8,8 @@ export default defineNuxtPlugin((nuxtApp) => { const api = $fetch.create({ onRequest({ request, options, error }) { options.baseURL = - config.public.NUXT_PUBLIC_BASE_URL + - config.public.NUXT_PUBLIC_API_NAME + + config.public.VITE_BASE_URL + + config.public.VITE_API_NAME + options.baseURL; if (token) { @@ -38,10 +38,10 @@ export default defineNuxtPlugin((nuxtApp) => { // Add custom methods for GET, POST, and DELETE const http = { - getRequest: (url, options = {}) => api(url, { method: "GET", ...options }), - postRequest: (url, body, options = {}) => + getRequest: (url: string, options = {}) => api(url, { method: "GET", ...options }), + postRequest: (url: string, body: any, options = {}) => api(url, { method: "POST", body, ...options }), - deleteRequest: (url, options = {}) => + deleteRequest: (url: string, options = {}) => api(url, { method: "DELETE", ...options }), };