Compare commits

...

2 Commits

Author SHA1 Message Date
Mehdi104797
98fdf1c3fb . 2025-04-03 13:27:41 +03:30
Mehdi104797
219f12c2b2 . 2025-04-03 13:27:09 +03:30
2 changed files with 6 additions and 6 deletions

View File

@ -8,8 +8,8 @@ export default defineNuxtPlugin((nuxtApp) => {
const api = $fetch.create({ const api = $fetch.create({
onRequest({ request, options, error }) { onRequest({ request, options, error }) {
options.baseURL = options.baseURL =
config.public.NUXT_PUBLIC_BASE_URL + config.public.VITE_BASE_URL +
config.public.NUXT_PUBLIC_API_NAME + config.public.VITE_API_NAME +
options.baseURL; options.baseURL;
if (token) { if (token) {
@ -38,10 +38,10 @@ export default defineNuxtPlugin((nuxtApp) => {
// Add custom methods for GET, POST, and DELETE // Add custom methods for GET, POST, and DELETE
const http = { const http = {
getRequest: (url, options = {}) => api(url, { method: "GET", ...options }), getRequest: (url: string, options = {}) => api(url, { method: "GET", ...options }),
postRequest: (url, body, options = {}) => postRequest: (url: string, body: any, options = {}) =>
api(url, { method: "POST", body, ...options }), api(url, { method: "POST", body, ...options }),
deleteRequest: (url, options = {}) => deleteRequest: (url: string, options = {}) =>
api(url, { method: "DELETE", ...options }), api(url, { method: "DELETE", ...options }),
}; };

@ -1 +1 @@
Subproject commit daf14f2b1b116129a1c19e732df84d38d07b6275 Subproject commit 40b37e8f08bede2cb15f0b2fc5c639823c59b40e