chore: build

This commit is contained in:
2026-05-09 16:50:23 +02:00
parent 78c498159d
commit 7af2103164
8 changed files with 29 additions and 18 deletions
+3 -3
View File
@@ -15,7 +15,7 @@
"simulator": true "simulator": true
}, },
"env": { "env": {
"API_URL": "https://mln-uber.club" "EXPO_PUBLIC_API_URL": "https://5.181.0.112.nip.io"
} }
}, },
"preview": { "preview": {
@@ -24,7 +24,7 @@
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"API_URL": "https://mln-uber.club" "EXPO_PUBLIC_API_URL": "https://5.181.0.112.nip.io"
} }
}, },
"production": { "production": {
@@ -34,7 +34,7 @@
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"API_URL": "https://mln-uber.club" "EXPO_PUBLIC_API_URL": "https://mln-uber.club"
} }
} }
} }
+4 -3
View File
@@ -1,4 +1,5 @@
import apiClient from "./client"; import apiClient from "./client";
import { API_BASE_URL } from "./client";
import type { import type {
AuthResponse, AuthResponse,
ClientResponse, ClientResponse,
@@ -9,9 +10,9 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const V2 = "https://mln-uber.club/api/v2"; const V2 = `${API_BASE_URL}/api/v2`;
const CABINE_URL = "https://mln-uber.club/api/v1/cabine"; const CABINE_URL = `${API_BASE_URL}/api/v1/cabine`;
const V1_PUBLIC = "https://mln-uber.club/api/v1"; const V1_PUBLIC = `${API_BASE_URL}/api/v1`;
export const loginAdmin = async ( export const loginAdmin = async (
username: string, username: string,
+4 -2
View File
@@ -1,4 +1,6 @@
import apiClient from "./client"; import apiClient from "./client";
import { API_BASE_URL } from "./client";
import type { import type {
OrderItem, OrderItem,
DeliveryPerson, DeliveryPerson,
@@ -6,8 +8,8 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const API = "https://mln-uber.club/api/v1/cabine"; const API = `${API_BASE_URL}/api/v1/cabine`;
const V2 = "https://mln-uber.club/api/v2"; const V2 = `${API_BASE_URL}/api/v2`;
export const getCommandItems = async (commandId: number) => { export const getCommandItems = async (commandId: number) => {
const { data } = await apiClient.get(`${API}/commands/${commandId}/items`); const { data } = await apiClient.get(`${API}/commands/${commandId}/items`);
+2 -1
View File
@@ -1,4 +1,5 @@
import apiClient from "./client"; import apiClient from "./client";
import { API_BASE_URL } from "./client";
import type { import type {
DeliveryStatus, DeliveryStatus,
QueueInfo, QueueInfo,
@@ -7,7 +8,7 @@ import type {
Alert, Alert,
} from "./types"; } from "./types";
const API = "https://mln-uber.club/api/v1/livreur"; const API = `${API_BASE_URL}/api/v1/livreur`;
// ============================================ // ============================================
// STATUT // STATUT
+1 -2
View File
@@ -1,8 +1,7 @@
import axios from "axios"; import axios from "axios";
import { getToken, getAdminToken } from "../auth/tokenStorage"; import { getToken, getAdminToken } from "../auth/tokenStorage";
// Change this to your server IP/domain export const API_BASE_URL = process.env.EXPO_PUBLIC_API_URL ?? "https://mln-uber.club";
export const API_BASE_URL = "https://mln-uber.club";
const apiClient = axios.create({ const apiClient = axios.create({
baseURL: API_BASE_URL, baseURL: API_BASE_URL,
+3 -3
View File
@@ -15,7 +15,7 @@
"simulator": true "simulator": true
}, },
"env": { "env": {
"API_URL": "https://5.181.0.112.nip.io" "EXPO_PUBLIC_API_URL": "https://5.181.0.112.nip.io"
}, },
"channel": "development" "channel": "development"
}, },
@@ -25,7 +25,7 @@
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"API_URL": "https://5.181.0.112.nip.io" "EXPO_PUBLIC_API_URL": "https://5.181.0.112.nip.io"
}, },
"channel": "preview" "channel": "preview"
}, },
@@ -36,7 +36,7 @@
"buildType": "apk" "buildType": "apk"
}, },
"env": { "env": {
"API_URL": "https://5.181.0.112.nip.io/" "EXPO_PUBLIC_API_URL": "https://mln-uber.club"
}, },
"channel": "production" "channel": "production"
} }
+10 -3
View File
@@ -1,4 +1,5 @@
import apiClient from "./client"; import apiClient from "./client";
import { API_BASE_URL } from "./client";
import type { import type {
ConfirmReceptionResponse, ConfirmReceptionResponse,
CheckoutCartResponse, CheckoutCartResponse,
@@ -12,7 +13,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://mln-uber.club/api/v1"; const V1 = `${API_BASE_URL}/api/v1`;
export const getJwtUsername = async (): Promise<string | null> => { export const getJwtUsername = async (): Promise<string | null> => {
const token = await getToken(); const token = await getToken();
@@ -901,7 +902,11 @@ export const get2FAStatus = async (): Promise<{
const { data } = await apiClient.get(`${V1}/two-fa/status`); const { data } = await apiClient.get(`${V1}/two-fa/status`);
return data; return data;
} catch { } catch {
return { two_fa_enabled: false, telegram_linked: false, admin_2fa_enabled: false }; return {
two_fa_enabled: false,
telegram_linked: false,
admin_2fa_enabled: false,
};
} }
}; };
@@ -909,7 +914,9 @@ export const toggle2FA = async (
enabled: boolean, enabled: boolean,
): Promise<{ success: boolean; error?: string }> => { ): Promise<{ success: boolean; error?: string }> => {
try { try {
const { data } = await apiClient.post(`${V1}/two-fa/toggle`, { enabled }); const { data } = await apiClient.post(`${V1}/two-fa/toggle`, {
enabled,
});
return { success: data.success ?? true }; return { success: data.success ?? true };
} catch (e: any) { } catch (e: any) {
return { success: false, error: e?.response?.data?.error || "Erreur" }; return { success: false, error: e?.response?.data?.error || "Erreur" };
+2 -1
View File
@@ -2,7 +2,8 @@ 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://mln-uber.club"; export const API_BASE_URL =
process.env.EXPO_PUBLIC_API_URL ?? "https://mln-uber.club";
const apiClient = axios.create({ const apiClient = axios.create({
baseURL: API_BASE_URL, baseURL: API_BASE_URL,