diff --git a/src/App.jsx b/src/App.jsx index 5ba0454..c982aca 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -19,6 +19,7 @@ import Dashboard from './pages/app/Dashboard'; import Store from './pages/app/Store'; import Checkout from './pages/app/Checkout'; import Services from './pages/app/Services'; +import Support from './pages/app/Support'; export default function App() { return ( @@ -47,6 +48,7 @@ export default function App() { } /> } /> } /> + } /> diff --git a/src/services/api.js b/src/services/api.js index 2e218a2..d546f75 100644 --- a/src/services/api.js +++ b/src/services/api.js @@ -189,4 +189,35 @@ export const launchSSOGateway = (username, password) => { document.body.appendChild(form); form.submit(); document.body.removeChild(form); -}; \ No newline at end of file +}; + +// ========================================== +// ROUTES SUPPORT FOSSBILLING (NATIVES) +// ========================================== + +// Récupère la liste de tous les tickets du client +export const getClientTickets = () => + apiCall(`${BASE_URL}/api/client/support/ticket_get_list`, 'GET'); + +// Récupère le contenu et les messages d'un ticket spécifique +export const getTicketDetails = (ticketId) => + apiCall(`${BASE_URL}/api/client/support/ticket_get`, 'POST', { id: ticketId }); + +// Crée un nouveau ticket de support +export const createTicket = (subject, message, helpdesk_id) => + apiCall(`${BASE_URL}/api/client/support/ticket_create`, 'POST', { + support_helpdesk_id: helpdesk_id, + subject: subject, + content: message + }); + +// Répond à un ticket existant +export const replyTicket = (ticketId, message) => + apiCall(`${BASE_URL}/api/client/support/ticket_reply`, 'POST', { + id: ticketId, + content: message + }); + +// Récupère la liste dynamique des départements (Helpdesks) configurés sur FOSSBilling +export const getHelpdesks = () => + apiCall(`${BASE_URL}/api/client/support/helpdesk_get_pairs`, 'GET'); \ No newline at end of file