diff --git a/src/utils/auth/login.js b/src/utils/auth/login.js index c925521..96dc5ce 100644 --- a/src/utils/auth/login.js +++ b/src/utils/auth/login.js @@ -4,7 +4,7 @@ export default async function login(email, password) { const csrfToken = await getXSRFToken(); try { - const response = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/login`, { + const response = await fetch(`${import.meta.env.VITE_API_URL}/api/users/login`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/utils/auth/logout.js b/src/utils/auth/logout.js index fa34b2f..f45db75 100644 --- a/src/utils/auth/logout.js +++ b/src/utils/auth/logout.js @@ -5,7 +5,7 @@ export default async function logout() { const csrfToken = await getXSRFToken(); try { - const response = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/logout`, { + const response = await fetch(`${import.meta.env.VITE_API_URL}/api/users/logout`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/utils/events/createEvent.js b/src/utils/events/createEvent.js index d1b0735..66ece42 100644 --- a/src/utils/events/createEvent.js +++ b/src/utils/events/createEvent.js @@ -4,7 +4,7 @@ export default async function createEvent(name, description, start, end) { const csrfToken = await getXSRFToken(); try { - const response = await fetch(`http://${import.meta.env.VITE_API_URL}/api/events/create`, { + const response = await fetch(`${import.meta.env.VITE_API_URL}/api/events/create`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/utils/events/getAllEvents.js b/src/utils/events/getAllEvents.js index f5e37c5..7529282 100644 --- a/src/utils/events/getAllEvents.js +++ b/src/utils/events/getAllEvents.js @@ -1,7 +1,7 @@ export default async function getAllEvents() { try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/events/`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/events/`, { method: 'GET', credentials: 'include', headers: { diff --git a/src/utils/events/getEventById.js b/src/utils/events/getEventById.js index 8d09b78..4205125 100644 --- a/src/utils/events/getEventById.js +++ b/src/utils/events/getEventById.js @@ -1,7 +1,7 @@ export default async function GetEventById(id) { try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/events/${id}`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/events/${id}`, { method: 'GET', credentials: 'include', headers: { diff --git a/src/utils/events/searchEvents.js b/src/utils/events/searchEvents.js index a9974d0..aa8a327 100644 --- a/src/utils/events/searchEvents.js +++ b/src/utils/events/searchEvents.js @@ -2,7 +2,7 @@ export default async function searchEvents(query) { try { const encodedQuery = encodeURIComponent(query); const response = await fetch( - `http://${import.meta.env.VITE_API_URL}/api/events/search?query=${encodedQuery}`, + `${import.meta.env.VITE_API_URL}/api/events/search?query=${encodedQuery}`, { method: 'GET', credentials: 'include', diff --git a/src/utils/getUser.js b/src/utils/getUser.js index 24297ca..824f1d2 100644 --- a/src/utils/getUser.js +++ b/src/utils/getUser.js @@ -1,6 +1,6 @@ export default async function getUser() { try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/me`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users/me`, { method: 'GET', credentials: 'include', headers: { diff --git a/src/utils/getXSRF.js b/src/utils/getXSRF.js index 0c78e40..f1dc5fc 100644 --- a/src/utils/getXSRF.js +++ b/src/utils/getXSRF.js @@ -1,5 +1,5 @@ export default async function getXSRFToken() { - const response = await fetch(`http://${import.meta.env.VITE_API_URL}/sanctum/csrf-cookie`, { + const response = await fetch(`${import.meta.env.VITE_API_URL}/sanctum/csrf-cookie`, { method: 'GET', credentials: 'include' }); diff --git a/src/utils/notifications/deleteNotificationUser.js b/src/utils/notifications/deleteNotificationUser.js index 804c1dd..b7d7a93 100644 --- a/src/utils/notifications/deleteNotificationUser.js +++ b/src/utils/notifications/deleteNotificationUser.js @@ -4,7 +4,7 @@ export default async function deleteNotificationUser(notificationId) { const csrfToken = await getXSRFToken(); try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/delete/notification/${notificationId}`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users/delete/notification/${notificationId}`, { method: 'DELETE', credentials: 'include', headers: { diff --git a/src/utils/notifications/getUserNotifications.js b/src/utils/notifications/getUserNotifications.js index 491471f..69c0441 100644 --- a/src/utils/notifications/getUserNotifications.js +++ b/src/utils/notifications/getUserNotifications.js @@ -1,7 +1,7 @@ export default async function getUserNotifications() { try { const response = await fetch( - `http://${import.meta.env.VITE_API_URL}/api/users/notifications`, + `${import.meta.env.VITE_API_URL}/api/users/notifications`, { method: 'GET', credentials: 'include', diff --git a/src/utils/notifications/readNotifications.js b/src/utils/notifications/readNotifications.js index 3f504a6..0f406ce 100644 --- a/src/utils/notifications/readNotifications.js +++ b/src/utils/notifications/readNotifications.js @@ -5,7 +5,7 @@ export default async function readNotifications() { const csrfToken = await getXSRFToken(); try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/notifications/read`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users/notifications/read`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/utils/register.js b/src/utils/register.js index 43a8c1d..b1c5682 100644 --- a/src/utils/register.js +++ b/src/utils/register.js @@ -4,7 +4,7 @@ export default async function register(email, password, name, lastname, phone) { const csrfToken = await getXSRFToken(); try { - const response = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/register`, { + const response = await fetch(`${import.meta.env.VITE_API_URL}/api/users/register`, { method: 'POST', credentials: 'include', headers: { diff --git a/src/utils/tasks/assign.js b/src/utils/tasks/assign.js index 88f1ba8..1616e6c 100644 --- a/src/utils/tasks/assign.js +++ b/src/utils/tasks/assign.js @@ -5,7 +5,7 @@ export default async function assign(taskId) { try { const res = await fetch( - `http://${import.meta.env.VITE_API_URL}/api/events/task/assign`, + `${import.meta.env.VITE_API_URL}/api/events/task/assign`, { method: 'POST', credentials: 'include', @@ -34,4 +34,4 @@ export default async function assign(taskId) { message: "Network error", }; } -} +} \ No newline at end of file diff --git a/src/utils/tasks/isAssigned.js b/src/utils/tasks/isAssigned.js index 3b938a1..a7f36a1 100644 --- a/src/utils/tasks/isAssigned.js +++ b/src/utils/tasks/isAssigned.js @@ -1,7 +1,7 @@ export default async function isAssigned(taskId) { try { const res = await fetch( - `http://${import.meta.env.VITE_API_URL}/api/events/tasks/${taskId}/assigned`, + `${import.meta.env.VITE_API_URL}/api/events/tasks/${taskId}/assigned`, { method: 'GET', credentials: 'include', diff --git a/src/utils/tasks/unAssign.js b/src/utils/tasks/unAssign.js index 509ec82..4e140c4 100644 --- a/src/utils/tasks/unAssign.js +++ b/src/utils/tasks/unAssign.js @@ -5,7 +5,7 @@ export default async function unAssign(taskId) { try { const res = await fetch( - `http://${import.meta.env.VITE_API_URL}/api/events/task/unassign`, + `${import.meta.env.VITE_API_URL}/api/events/task/unassign`, { method: 'POST', credentials: 'include', diff --git a/src/utils/users/getAllUsers.js b/src/utils/users/getAllUsers.js index c9c383e..b31ff18 100644 --- a/src/utils/users/getAllUsers.js +++ b/src/utils/users/getAllUsers.js @@ -1,6 +1,6 @@ export default async function getAllUser() { try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users`, { method: 'GET', credentials: 'include', headers: { diff --git a/src/utils/users/getUserById.js b/src/utils/users/getUserById.js index 1fad659..5abbbc3 100644 --- a/src/utils/users/getUserById.js +++ b/src/utils/users/getUserById.js @@ -1,6 +1,6 @@ export default async function getUserById(id) { try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/${id}`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users/${id}`, { method: 'GET', credentials: 'include', headers: { diff --git a/src/utils/users/searchUsers.js b/src/utils/users/searchUsers.js index fdf9593..ae0bd3a 100644 --- a/src/utils/users/searchUsers.js +++ b/src/utils/users/searchUsers.js @@ -2,7 +2,7 @@ export default async function searchUsers(query) { try { const encodedQuery = encodeURIComponent(query); const response = await fetch( - `http://localhost:80/api/users/search?query=${encodedQuery}`, + `${import.meta.env.VITE_API_URL}/api/users/search?query=${encodedQuery}`, { method: 'GET', credentials: 'include', diff --git a/src/utils/users/updateUser.js b/src/utils/users/updateUser.js index dd2042e..05fe5d8 100644 --- a/src/utils/users/updateUser.js +++ b/src/utils/users/updateUser.js @@ -5,7 +5,7 @@ export default async function updateUser(name, lastname, phone) { const csrfToken = await getXSRFToken(); try { - const res = await fetch(`http://${import.meta.env.VITE_API_URL}/api/users/update`, { + const res = await fetch(`${import.meta.env.VITE_API_URL}/api/users/update`, { method: 'POST', credentials: 'include', headers: {