mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
fixes for editing calendar
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {COLORS} from '../const';
|
||||
import {ISOToDatetime} from 'ChillMainAssets/chill/js/date';
|
||||
|
||||
const addIdToValue = (string, id) => {
|
||||
let array = string ? string.split(',') : [];
|
||||
@@ -18,8 +19,25 @@ const removeIdFromValue = (string, id) => {
|
||||
* Assign missing keys for the ConcernedGroups component
|
||||
*/
|
||||
const mapEntity = (entity) => {
|
||||
Object.assign(entity, {thirdParties: entity.professionals, users: entity.invites});
|
||||
return entity;
|
||||
console.log('mapEntity', entity);
|
||||
let calendar = { ...entity};
|
||||
Object.assign(calendar, {thirdParties: entity.professionals, users: entity.invites});
|
||||
|
||||
if (entity.startDate !== null ) {
|
||||
calendar.startDate = ISOToDatetime(entity.startDate.datetime);
|
||||
}
|
||||
if (entity.endDate !== null) {
|
||||
calendar.endDate = ISOToDatetime(entity.endDate.datetime);
|
||||
}
|
||||
|
||||
if (entity.calendarRange !== null) {
|
||||
calendar.calendarRange.calendarRangeId = entity.calendarRange.id;
|
||||
calendar.calendarRange.id = `range_${entity.calendarRange.id}`;
|
||||
}
|
||||
|
||||
console.log('new calendar object ', calendar);
|
||||
|
||||
return calendar;
|
||||
};
|
||||
|
||||
const createUserData = (user, colorIndex) => {
|
||||
|
Reference in New Issue
Block a user