feat: planning events

This commit is contained in:
Luc SORIGNET
2025-03-02 15:35:56 +01:00
parent e3879f516b
commit c9b0f0d77a
21 changed files with 371 additions and 172 deletions

View File

@ -42,7 +42,13 @@ export const BE_SCHOOL_PAYMENT_PLANS_URL = `${BASE_URL}/School/paymentPlans`;
export const BE_SCHOOL_PAYMENT_MODES_URL = `${BASE_URL}/School/paymentModes`;
export const BE_SCHOOL_ESTABLISHMENT_URL = `${BASE_URL}/School/establishments`;
// En attendant la gestion des sessions
// GESTION PLANNING
export const BE_PLANNING_PLANNINGS_URL = `${BASE_URL}/Planning/plannings`
export const BE_PLANNING_EVENTS_URL = `${BASE_URL}/Planning/events`
// FIXME : En attendant la gestion des sessions
export const ESTABLISHMENT_ID = 1;
// GESTION MESSAGERIE

View File

@ -14,7 +14,7 @@ export const DEFAULT_EVENT = {
start: '',
end: '',
location: '',
scheduleId: 'default',
planning: 'default',
color: '#10b981',
recurrence: 'none',
selectedDays: [],

View File

@ -85,7 +85,7 @@ export const getWeekEvents = (day, events) => {
const start = startOfDay(day);
const end = endOfDay(day);
return events.filter(event => {
return events?.filter(event => {
const eventStart = new Date(event.start);
const eventEnd = new Date(event.end);
@ -106,5 +106,5 @@ export const getWeekEvents = (day, events) => {
* @returns {Array<Object>} Liste des événements filtrés
*/
export const filterEventsByVisibleSchedules = (events, hiddenSchedules) => {
return events.filter(event => !hiddenSchedules.includes(event.scheduleId));
return events.filter(event => !hiddenSchedules.includes(event.planning));
};