Checkpoint: Évolution du système de rappels pour permettre jusqu'à 2 pièces jointes au lieu d'une seule. Migration SQL appliquée en local et sur le VPS de production. Les rappels existants sont préservés.
This commit is contained in:
@@ -59,6 +59,13 @@ export default function AdminRappels() {
|
||||
typeFichier: string;
|
||||
tailleFichier: number;
|
||||
} | null,
|
||||
fichier2: null as {
|
||||
nomFichier: string;
|
||||
urlFichier: string;
|
||||
s3Key: string;
|
||||
typeFichier: string;
|
||||
tailleFichier: number;
|
||||
} | null,
|
||||
});
|
||||
|
||||
const { data: rappels, refetch } = trpc.rappels.list.useQuery();
|
||||
@@ -113,6 +120,7 @@ export default function AdminRappels() {
|
||||
nom: "",
|
||||
templateType: "",
|
||||
fichier: null,
|
||||
fichier2: null,
|
||||
timing: "pre_formation",
|
||||
joursAvant: 7,
|
||||
heureEnvoi: "09:00",
|
||||
@@ -146,6 +154,13 @@ export default function AdminRappels() {
|
||||
typeFichier: rappel.typeFichier,
|
||||
tailleFichier: rappel.tailleFichier,
|
||||
} : null,
|
||||
fichier2: rappel.nomFichier2 ? {
|
||||
nomFichier: rappel.nomFichier2,
|
||||
urlFichier: rappel.urlFichier2,
|
||||
s3Key: rappel.s3Key2,
|
||||
typeFichier: rappel.typeFichier2,
|
||||
tailleFichier: rappel.tailleFichier2,
|
||||
} : null,
|
||||
});
|
||||
setIsEditOpen(true);
|
||||
};
|
||||
@@ -694,12 +709,25 @@ export default function AdminRappels() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 1 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 2 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
@@ -840,12 +868,25 @@ export default function AdminRappels() {
|
||||
/>
|
||||
</div>
|
||||
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 1 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier}
|
||||
onChange={(fichier) => setFormData({ ...formData, fichier })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="space-y-2">
|
||||
<Label>Pièce jointe 2 (optionnel)</Label>
|
||||
<FileUpload
|
||||
value={formData.fichier2}
|
||||
onChange={(fichier2) => setFormData({ ...formData, fichier2 })}
|
||||
accept=".pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.jpg,.jpeg,.png"
|
||||
maxSize={10}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center space-x-2">
|
||||
<Switch
|
||||
|
||||
Reference in New Issue
Block a user