Fix backend url conf
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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'
|
||||
});
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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",
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user