fix: Resolve TypeScript errors in page.tsx and phases-chantier/page.tsx
This commit is contained in:
@@ -20,6 +20,7 @@ import { Checkbox } from 'primereact/checkbox';
|
||||
import { factureService } from '../../../../../services/api';
|
||||
import { formatDate, formatCurrency } from '../../../../../utils/formatters';
|
||||
import type { Facture } from '../../../../../types/btp';
|
||||
import { StatutFacture } from '../../../../../types/btp';
|
||||
|
||||
interface Relance {
|
||||
id: string;
|
||||
@@ -85,7 +86,7 @@ const FactureRelancePage = () => {
|
||||
|
||||
// Charger la facture
|
||||
const factureResponse = await factureService.getById(factureId);
|
||||
setFacture(factureResponse.data);
|
||||
setFacture(factureResponse);
|
||||
|
||||
// TODO: Charger les relances et templates depuis l'API
|
||||
// const relancesResponse = await factureService.getRelances(factureId);
|
||||
@@ -142,8 +143,8 @@ const FactureRelancePage = () => {
|
||||
setTemplates(mockTemplates);
|
||||
|
||||
// Pré-remplir le destinataire
|
||||
if (factureResponse.data.client) {
|
||||
const client = factureResponse.data.client;
|
||||
if (factureResponse.client) {
|
||||
const client = factureResponse.client;
|
||||
setNouvelleRelance(prev => ({
|
||||
...prev,
|
||||
destinataire: typeof client === 'string' ? client : client.email || client.nom
|
||||
@@ -309,9 +310,9 @@ const FactureRelancePage = () => {
|
||||
<div>
|
||||
<h2 className="text-2xl font-bold mb-2">Relances - Facture #{facture.numero}</h2>
|
||||
<p className="text-600 mb-3">{facture.objet}</p>
|
||||
<Tag
|
||||
value={facture.statut}
|
||||
severity={facture.statut === 'EN_RETARD' ? 'danger' : 'warning'}
|
||||
<Tag
|
||||
value={facture.statut}
|
||||
severity={facture.statut === StatutFacture.ECHUE ? 'danger' : 'warning'}
|
||||
/>
|
||||
</div>
|
||||
<div className="text-right">
|
||||
|
||||
Reference in New Issue
Block a user