mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-04-05 20:51:26 +00:00
feat: Preparation des modèles Settings pour l'enregistrement SMTP [#17]
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user