feat: Preparation des modèles Settings pour l'enregistrement SMTP [#17]

This commit is contained in:
Luc SORIGNET
2025-05-05 09:25:07 +02:00
parent 99a882a64a
commit eda6f587fb
33 changed files with 468 additions and 74 deletions

View File

@ -1,6 +1,7 @@
import { usePlanning } from '@/context/PlanningContext';
import { format } from 'date-fns';
import React from 'react';
import { useNotification } from '@/context/NotificationContext';
export default function ScheduleEventModal({
isOpen,
@ -13,6 +14,7 @@ export default function ScheduleEventModal({
}) {
const { addEvent, handleUpdateEvent, handleDeleteEvent, schedules } =
usePlanning();
const { showNotification } = useNotification();
React.useEffect(() => {
if (!eventData?.planning && schedules.length > 0) {
@ -78,22 +80,34 @@ export default function ScheduleEventModal({
e.preventDefault();
if (!eventData.speciality) {
alert('Veuillez sélectionner une matière');
showNotification(
'Veuillez sélectionner une matière',
'warning',
'Attention'
);
return;
}
if (!eventData.teacher) {
alert('Veuillez sélectionner un professeur');
showNotification(
'Veuillez sélectionner un professeur',
'warning',
'Attention'
);
return;
}
if (!eventData.planning) {
alert('Veuillez sélectionner un planning');
showNotification(
'Veuillez sélectionner un planning',
'warning',
'Attention'
);
return;
}
if (!eventData.location) {
alert('Veuillez saisir un lieu');
showNotification('Veuillez saisir un lieu', 'warning', 'Attention');
return;
}