Fix: Conversion complète vers PrimeReact et corrections build

CONVERSIONS UI (8 pages):
 Remplacement de tous les composants Shadcn/UI par PrimeReact
- Card, Button, Input, Textarea, Badge → Card, Button, InputText, InputTextarea, Tag
- Conversion de toutes les icônes lucide-react en primeicons

Pages converties:
- app/(main)/aide/page.tsx
- app/(main)/aide/documentation/page.tsx
- app/(main)/aide/tutoriels/page.tsx
- app/(main)/aide/support/page.tsx
- app/(main)/messages/page.tsx
- app/(main)/messages/nouveau/page.tsx
- app/(main)/messages/envoyes/page.tsx
- app/(main)/messages/archives/page.tsx

CORRECTIONS BUILD:
 Résolution des conflits de dépendances FullCalendar
- @fullcalendar/core: 6.1.4 → ^6.1.19
- Alignement avec daygrid, timegrid, interaction, react

 Correction des erreurs TypeScript
- DataTable: Ajout de selectionMode="multiple"
- InputText number: Conversion number → string avec .toString()

 Correction des services API (3 fichiers)
- fournisseurService.ts
- notificationService.ts
- userService.ts
- Remplacement des appels apiService.get() par axios direct
- Ajout du préfixe /api/v1/ à tous les endpoints
- Configuration d'interceptors pour authentication tokens

RÉSULTAT:
 Build réussi: 126 pages générées
 0 erreurs de compilation
 0 erreurs TypeScript
 Architecture cohérente avec PrimeReact

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
dahoud
2025-10-31 10:24:30 +00:00
parent 9f4062b5f6
commit a7f8596947
14 changed files with 550 additions and 475 deletions

View File

@@ -1,4 +1,5 @@
import { apiService } from './api';
import axios from 'axios';
import { API_CONFIG } from '../config/api';
export interface Notification {
id: string;
@@ -27,13 +28,30 @@ export interface NotificationStats {
}[];
}
const api = axios.create({
baseURL: API_CONFIG.baseURL,
timeout: API_CONFIG.timeout,
headers: API_CONFIG.headers,
});
// Interceptor pour ajouter le token
api.interceptors.request.use((config) => {
if (typeof window !== 'undefined') {
const accessToken = localStorage.getItem('accessToken');
if (accessToken) {
config.headers['Authorization'] = `Bearer ${accessToken}`;
}
}
return config;
});
class NotificationService {
/**
* Récupérer toutes les notifications
*/
async getNotifications(): Promise<Notification[]> {
try {
const response = await apiService.get('/notifications');
const response = await api.get('/api/v1/notifications');
return response.data;
} catch (error) {
console.error('Erreur lors de la récupération des notifications:', error);
@@ -46,7 +64,7 @@ class NotificationService {
*/
async getUnreadNotifications(): Promise<Notification[]> {
try {
const response = await apiService.get('/notifications/unread');
const response = await api.get('/api/v1/notifications/unread');
return response.data;
} catch (error) {
console.error('Erreur lors de la récupération des notifications non lues:', error);
@@ -59,7 +77,7 @@ class NotificationService {
*/
async markAsRead(notificationId: string): Promise<void> {
try {
await apiService.put(`/notifications/${notificationId}/read`);
await api.put(`/api/v1/notifications/${notificationId}/read`);
} catch (error) {
console.error('Erreur lors du marquage de la notification comme lue:', error);
}
@@ -70,7 +88,7 @@ class NotificationService {
*/
async markAllAsRead(): Promise<void> {
try {
await apiService.put('/notifications/mark-all-read');
await api.put('/api/v1/notifications/mark-all-read');
} catch (error) {
console.error('Erreur lors du marquage de toutes les notifications comme lues:', error);
}
@@ -81,7 +99,7 @@ class NotificationService {
*/
async createNotification(notification: Omit<Notification, 'id' | 'date'>): Promise<Notification> {
try {
const response = await apiService.post('/notifications', notification);
const response = await api.post('/api/v1/notifications', notification);
return response.data;
} catch (error) {
console.error('Erreur lors de la création de la notification:', error);
@@ -99,7 +117,7 @@ class NotificationService {
*/
async deleteNotification(notificationId: string): Promise<void> {
try {
await apiService.delete(`/notifications/${notificationId}`);
await api.delete(`/api/v1/notifications/${notificationId}`);
} catch (error) {
console.error('Erreur lors de la suppression de la notification:', error);
}
@@ -110,7 +128,7 @@ class NotificationService {
*/
async getNotificationStats(): Promise<NotificationStats> {
try {
const response = await apiService.get('/notifications/stats');
const response = await api.get('/api/v1/notifications/stats');
return response.data;
} catch (error) {
console.error('Erreur lors de la récupération des statistiques:', error);
@@ -129,7 +147,7 @@ class NotificationService {
roles?: string[];
}): Promise<void> {
try {
await apiService.post('/notifications/broadcast', notification);
await api.post('/api/v1/notifications/broadcast', notification);
} catch (error) {
console.error('Erreur lors de la diffusion de la notification:', error);
}