-
, li: ({node, ...props}) => {props.children}, p: ({node, ...props}) => , strong: ({node, ...props}) => }}>
+ , li: ({node, ...props}) => {props.children}, p: ({node, ...props}) => , strong: ({node, ...props}) => }}>
{product.description || "Aucune description technique."}
diff --git a/src/pages/app/Checkout.jsx b/src/pages/app/Checkout.jsx
index 861a432..10bac82 100644
--- a/src/pages/app/Checkout.jsx
+++ b/src/pages/app/Checkout.jsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useParams, useSearchParams, useNavigate } from 'react-router-dom';
-import { resetCart, addToCart, checkoutCart, getProductList, getClientProfile } from '../../services/api';
+import { resetCart, addToCart, checkoutCart, getProductList, getClient } from '../../services/billing_api';
export default function Checkout() {
const { productId } = useParams();
@@ -18,7 +18,7 @@ export default function Checkout() {
useEffect(() => {
const loadData = async () => {
try {
- // 1. On charge d'abord le produit (Requête Publique)
+ // 1. On charge d'abord le produit
const productData = await getProductList();
const foundProduct = productData.list?.find(p => p.id === parseInt(productId));
@@ -29,15 +29,14 @@ export default function Checkout() {
}
setProduct(foundProduct);
- // 2. Ensuite, on tente de charger le profil (Requête Privée)
+ // 2. Ensuite, on tente de charger le profil
try {
- const profileData = await getClientProfile();
+ const profileData = await getClient();
setUserProfile(profileData);
} catch (profileErr) {
// Si on tombe ici, c'est que FOSSBilling refuse l'accès au profil.
console.error("Rejet API Profil :", profileErr);
setError("Accès refusé. Vous devez être connecté à votre compte pour provisionner une instance.");
- // Tu pourras décommenter la ligne suivante plus tard pour forcer la redirection :
// navigate('/login');
setIsLoading(false);
return;
diff --git a/src/pages/app/Dashboard.jsx b/src/pages/app/Dashboard.jsx
index 58b2d24..4358746 100644
--- a/src/pages/app/Dashboard.jsx
+++ b/src/pages/app/Dashboard.jsx
@@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
-import { getClientOrders } from '../../services/api';
+import { getOrdersList } from '../../services/billing_api';
import { AlertCircle, Loader, FileText, X } from 'lucide-react';
// Importation des composants
@@ -23,7 +23,7 @@ export default function Dashboard() {
const fetchInventory = async () => {
setIsLoading(true);
try {
- const data = await getClientOrders();
+ const data = await getOrdersList();
if (data.list) {
// LE FILTRE CHIRURGICAL PAR PREFIXE
diff --git a/src/pages/app/Services.jsx b/src/pages/app/Services.jsx
index e11a169..c998546 100644
--- a/src/pages/app/Services.jsx
+++ b/src/pages/app/Services.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useCallback } from 'react';
-import { getClientOrders, getOrderDetails } from '../../services/api';
+import { getOrdersList, getOrderDetails } from '../../services/billing_api';
import { useVPC } from '../../services/useVPC';
import { Server, Globe, Folder, Trash2, Loader, Plus, AlertCircle } from 'lucide-react';
@@ -25,7 +25,7 @@ export default function Services() {
const fetchServices = useCallback(async () => {
try {
- const data = await getClientOrders();
+ const data = await getOrdersList();
if (data.list && data.list.length > 0) {
const detailedServices = await Promise.all(data.list.map(async (order) => {
let hDetails = null;
diff --git a/src/pages/app/Store.jsx b/src/pages/app/Store.jsx
index 117fac6..cb357a6 100644
--- a/src/pages/app/Store.jsx
+++ b/src/pages/app/Store.jsx
@@ -1,8 +1,8 @@
// src/pages/app/Store.jsx
import { useState, useEffect } from 'react';
import { Server, Database, Cloud, Globe, Loader, AlertCircle } from 'lucide-react';
-import { getProductList } from '../../services/api';
-import CategorySection from '../../components/store/CategorySection'; // L'import magique
+import { getProductList } from '../../services/billing_api';
+import CategorySection from '../../components/store/CategorySection';
export default function Store() {
const [groupedProducts, setGroupedProducts] = useState({});
diff --git a/src/pages/public/Login.jsx b/src/pages/public/Login.jsx
index c5a3864..4f7acf1 100644
--- a/src/pages/public/Login.jsx
+++ b/src/pages/public/Login.jsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { useNavigate, Link } from 'react-router-dom';
-import { loginClient } from '../../services/api';
+import { loginClient } from '../../services/billing_api';
export default function Login() {
const [email, setEmail] = useState('');
diff --git a/src/pages/public/Register.jsx b/src/pages/public/Register.jsx
index 674188c..cd31aa8 100644
--- a/src/pages/public/Register.jsx
+++ b/src/pages/public/Register.jsx
@@ -1,6 +1,6 @@
import { useState } from 'react';
import { useNavigate, Link } from 'react-router-dom';
-import { registerUnifiedClient } from '../../services/api';
+import { createNewClient } from '../../services/billing_api';
import NotificationModal from '../../components/ui/NotificationModal';
export default function Register() {
@@ -10,7 +10,7 @@ export default function Register() {
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
const [confirmPassword, setConfirmPassword] = useState('');
-
+
const [loading, setLoading] = useState(false);
const [customAlert, setCustomAlert] = useState(null);
const navigate = useNavigate();
@@ -28,15 +28,15 @@ export default function Register() {
setCustomAlert({ type: 'error', title: 'Erreur de saisie', message: "Les clés d'accès ne correspondent pas." });
return;
}
- if (!/^[a-zA-Z0-9]{3,12}$/.test(username)) {
+ if (!/^[a-zA-Z0-9]{3,20}$/.test(username)) {
setCustomAlert({ type: 'error', title: 'Identifiant invalide', message: "Le nom d'utilisateur doit contenir uniquement des lettres ou chiffres (entre 3 et 12 caractères)." });
return;
}
setLoading(true);
try {
- await registerUnifiedClient(email, username, password, firstName, lastName);
- setCustomAlert({ type: 'success', title: 'PROVISIONNEMENT RÉUSSI', message: "Vos comptes FOSSBilling, HestiaCP et Nextcloud ont été initialisés.\n\nVous pouvez maintenant vous connecter." });
+ await createNewClient(email, firstName, lastName, password, confirmPassword, "individual", username);
+ setCustomAlert({ type: 'success', title: 'PROVISIONNEMENT RÉUSSI', message: "Votre compte a été initialisé.\n\nVous pouvez maintenant vous connecter." });
} catch (err) {
setCustomAlert({ type: 'error', title: 'Échec du Déploiement', message: err.message || "Échec de l'initialisation." });
} finally {
@@ -56,7 +56,7 @@ export default function Register() {
Créer un accès réseau
- [ INITIALISATION DU PROVISIONNEMENT TRIPLE ]
+ [ INITIALISATION DU PROVISIONNEMENT ]