chore: fix URL

This commit is contained in:
2026-03-06 16:17:29 +01:00
parent 12b65d54c0
commit e4462a1d69
6 changed files with 24 additions and 11 deletions
+13 -4
View File
@@ -9,8 +9,8 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const V2 = "https://uber-stup.club/api/v2"; const V2 = "http://5.181.0.112/api/v2";
const CABINE_URL = "https://uber-stup.club/api/v1/cabine"; const CABINE_URL = "http://5.181.0.112/api/v1/cabine";
// ============================================ // ============================================
// AUTH // AUTH
@@ -177,7 +177,11 @@ export const notifyClientToDescend = async (commandId: number) => {
const { data } = await apiClient.post( const { data } = await apiClient.post(
`${V2}/admin/protected/orders/${commandId}/notify-client`, `${V2}/admin/protected/orders/${commandId}/notify-client`,
); );
return { success: true, message: data.message, client_username: data.client_username }; return {
success: true,
message: data.message,
client_username: data.client_username,
};
}; };
export const confirmReceptionAdmin = async (commandId: number) => { export const confirmReceptionAdmin = async (commandId: number) => {
@@ -531,7 +535,12 @@ export const deleteAddress = async (
): Promise<{ success: boolean; message: string }> => { ): Promise<{ success: boolean; message: string }> => {
const { data } = await apiClient.delete( const { data } = await apiClient.delete(
`${V2}/admin/protected/delete/address`, `${V2}/admin/protected/delete/address`,
{ data: { invalid_address: invalidAddress, correct_address: correctAddress } }, {
data: {
invalid_address: invalidAddress,
correct_address: correctAddress,
},
},
); );
return { success: true, message: data.message }; return { success: true, message: data.message };
}; };
+7 -3
View File
@@ -6,8 +6,8 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const API = "https://uber-stup.club/api/v1/cabine"; const API = "http://5.181.0.112/api/v1/cabine";
const V2 = "https://uber-stup.club/api/v2"; const V2 = "http://5.181.0.112/api/v2";
// ============================================ // ============================================
// ITEMS // ITEMS
@@ -121,7 +121,11 @@ export const notifyClientToDescendCabine = async (commandId: number) => {
const { data } = await apiClient.post( const { data } = await apiClient.post(
`${API}/commands/${commandId}/notify-client`, `${API}/commands/${commandId}/notify-client`,
); );
return { success: true, message: data.message, client_username: data.client_username }; return {
success: true,
message: data.message,
client_username: data.client_username,
};
}; };
export const getCabineLivreursList = async (): Promise< export const getCabineLivreursList = async (): Promise<
+1 -1
View File
@@ -7,7 +7,7 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const API = "https://uber-stup.club/api/v1/livreur"; const API = "http://5.181.0.112/api/v1/livreur";
// ============================================ // ============================================
// STATUT // STATUT
+1 -1
View File
@@ -2,7 +2,7 @@ import axios from "axios";
import { getToken, getAdminToken } from "../auth/tokenStorage"; import { getToken, getAdminToken } from "../auth/tokenStorage";
// Change this to your server IP/domain // Change this to your server IP/domain
export const API_BASE_URL = "https://uber-stup.club"; export const API_BASE_URL = "http://5.181.0.112";
const apiClient = axios.create({ const apiClient = axios.create({
baseURL: API_BASE_URL, baseURL: API_BASE_URL,
+1 -1
View File
@@ -11,7 +11,7 @@ import type {
import { getToken } from "../auth/tokenStorage"; import { getToken } from "../auth/tokenStorage";
import { extractUsernameFromToken } from "../auth/jwtUtils"; import { extractUsernameFromToken } from "../auth/jwtUtils";
const V1 = "https://uber-stup.club/api/v1"; const V1 = "http://5.181.0.112/api/v1";
export const getJwtUsername = async (): Promise<string | null> => { export const getJwtUsername = async (): Promise<string | null> => {
const token = await getToken(); const token = await getToken();
+1 -1
View File
@@ -2,7 +2,7 @@ import axios from "axios";
import { getToken, getAdminToken } from "../auth/tokenStorage"; import { getToken, getAdminToken } from "../auth/tokenStorage";
// Change this to your server IP/domain // Change this to your server IP/domain
export const API_BASE_URL = "https://uber-stup.club"; export const API_BASE_URL = "http://5.181.0.112";
const apiClient = axios.create({ const apiClient = axios.create({
baseURL: API_BASE_URL, baseURL: API_BASE_URL,