chore: Outlook `processBusyTimes` iterate busy times once (#11350)
parent
49364eee9a
commit
bb0574dff8
|
@ -454,12 +454,13 @@ export default class Office365CalendarService implements Calendar {
|
||||||
(acc: BufferedBusyTime[], subResponse: { body: { value?: BodyValue[]; error?: Error[] } }) => {
|
(acc: BufferedBusyTime[], subResponse: { body: { value?: BodyValue[]; error?: Error[] } }) => {
|
||||||
if (!subResponse.body?.value) return acc;
|
if (!subResponse.body?.value) return acc;
|
||||||
return acc.concat(
|
return acc.concat(
|
||||||
subResponse.body.value
|
subResponse.body.value.reduce((acc: BufferedBusyTime[], evt: BodyValue) => {
|
||||||
.filter((evt) => evt.showAs !== "free" && evt.showAs !== "workingElsewhere")
|
if (evt.showAs === "free" || evt.showAs === "workingElsewhere") return acc;
|
||||||
.map((evt) => ({
|
return acc.concat({
|
||||||
start: evt.start.dateTime + "Z",
|
start: evt.start.dateTime + "Z",
|
||||||
end: evt.end.dateTime + "Z",
|
end: evt.end.dateTime + "Z",
|
||||||
}))
|
});
|
||||||
|
}, [])
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
[]
|
[]
|
||||||
|
|
Loading…
Reference in New Issue