diff --git a/src/back/calendar_of_events/views.py b/src/back/calendar_of_events/views.py index 3152feda9..914d8dbbd 100644 --- a/src/back/calendar_of_events/views.py +++ b/src/back/calendar_of_events/views.py @@ -40,6 +40,7 @@ class MyCalendars(APIView): ''' try: + ob=MyCalendarPostParameters(data=request.data) if ob.is_valid(): ob = ob.data diff --git a/src/front/src/components/calendar_of_events/calendar-create-select.vue b/src/front/src/components/calendar_of_events/calendar-create-select.vue index 836f9da6f..8fcc4ea4f 100644 --- a/src/front/src/components/calendar_of_events/calendar-create-select.vue +++ b/src/front/src/components/calendar_of_events/calendar-create-select.vue @@ -105,11 +105,17 @@ export default { setup(props, { emit }) { const filtered = ref(""); const staff = ref([]); + + const calendarParticipant = computed({ + get: () => props.participant, + set: (value) => emit("update:participant", value), + }); + axiosApiInstance .get("api/calendar_of_events/get_employees/") .then((res) => { staff.value = res.data.filter((e) => e.employees.length > 0); - + staff.value.forEach((e) => { if (props.participant.length > 0) { e.employees.forEach((empl) => { @@ -125,18 +131,38 @@ export default { }); }); + + const selectedStaff = computed(() => { + let selected = []; + // let idEmployees = props.participant + + + + + staff.value.forEach((e) => { + + e.employees + .filter((n) => n.selected == true) + .map((res) => { + calendarParticipant.value.push({ participant_calendar: res.id }); + }); if (e.employees.every((n) => n.selected == true)) { e.selected = true; selected.push(e); - } else { + } + else { e.selected = false; selected.push(...e.employees.filter((n) => n.selected == true)); } }); + + + // calendarParticipant.value = idEmployees + return selected; }); diff --git a/src/front/src/components/calendar_of_events/calendar-create.vue b/src/front/src/components/calendar_of_events/calendar-create.vue index ebd797646..cdf473207 100644 --- a/src/front/src/components/calendar_of_events/calendar-create.vue +++ b/src/front/src/components/calendar_of_events/calendar-create.vue @@ -1,10 +1,10 @@ diff --git a/src/front/src/layouts/default/alertDefault.vue b/src/front/src/layouts/default/alertDefault.vue index 7519b9215..ae1410980 100644 --- a/src/front/src/layouts/default/alertDefault.vue +++ b/src/front/src/layouts/default/alertDefault.vue @@ -1,63 +1,47 @@ - \ No newline at end of file +