Fix backend url conf
This commit is contained in:
@@ -4,7 +4,7 @@ export default async function login(email, password) {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function logout() {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default async function createEvent(name, description, start, end) {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default async function getAllEvents() {
|
export default async function getAllEvents() {
|
||||||
|
|
||||||
try {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default async function GetEventById(id) {
|
export default async function GetEventById(id) {
|
||||||
|
|
||||||
try {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export default async function searchEvents(query) {
|
|||||||
try {
|
try {
|
||||||
const encodedQuery = encodeURIComponent(query);
|
const encodedQuery = encodeURIComponent(query);
|
||||||
const response = await fetch(
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default async function getUser() {
|
export default async function getUser() {
|
||||||
try {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export default async function getXSRFToken() {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default async function deleteNotificationUser(notificationId) {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'DELETE',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
export default async function getUserNotifications() {
|
export default async function getUserNotifications() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function readNotifications() {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export default async function register(email, password, name, lastname, phone) {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function assign(taskId) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
@@ -34,4 +34,4 @@ export default async function assign(taskId) {
|
|||||||
message: "Network error",
|
message: "Network error",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
export default async function isAssigned(taskId) {
|
export default async function isAssigned(taskId) {
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function unAssign(taskId) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await fetch(
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default async function getAllUser() {
|
export default async function getAllUser() {
|
||||||
try {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
export default async function getUserById(id) {
|
export default async function getUserById(id) {
|
||||||
try {
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ export default async function searchUsers(query) {
|
|||||||
try {
|
try {
|
||||||
const encodedQuery = encodeURIComponent(query);
|
const encodedQuery = encodeURIComponent(query);
|
||||||
const response = await fetch(
|
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',
|
method: 'GET',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ export default async function updateUser(name, lastname, phone) {
|
|||||||
const csrfToken = await getXSRFToken();
|
const csrfToken = await getXSRFToken();
|
||||||
|
|
||||||
try {
|
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',
|
method: 'POST',
|
||||||
credentials: 'include',
|
credentials: 'include',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user