calendar app: set mainUser and options for form

This commit is contained in:
2022-05-24 22:45:43 +02:00
parent 352b5b41b0
commit eb8b8c6939
10 changed files with 149 additions and 73 deletions

View File

@@ -99,16 +99,18 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
$ids = array_map(function ($item) { return $item['id']; }, $bareEvents['value']);
$existingIdsInRange = $this->calendarRangeRepository->findRemoteIdsPresent($ids);
return array_map(
function ($item) {
return $this->remoteEventConverter->convertToRemote($item);
},
// filter all event to keep only the one not in range
array_filter(
$bareEvents['value'],
function ($item) use ($existingIdsInRange) {
return (!$existingIdsInRange[$item['id']]) ?? true;
}
return array_values(
array_map(
function ($item) {
return $this->remoteEventConverter->convertToRemote($item);
},
// filter all event to keep only the one not in range
array_filter(
$bareEvents['value'],
function ($item) use ($existingIdsInRange) {
return (!$existingIdsInRange[$item['id']]) ?? true;
}
)
)
);
} catch (ClientExceptionInterface $e) {