[#340] show declined event in settings (#398)

* [#340] show declined event in settings


Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
Camille Moussu
2025-12-09 11:11:20 +01:00
committed by GitHub
parent 2f2ee369fc
commit 3cb445ea79
9 changed files with 140 additions and 13 deletions
+14
View File
@@ -40,6 +40,7 @@ export interface UserConfigurationUpdates {
timezone?: string | null;
previousConfig?: Record<string, any>;
alarmEmails?: boolean;
hideDeclinedEvents?: boolean;
}
export async function updateUserConfigurations(
@@ -47,6 +48,7 @@ export async function updateUserConfigurations(
): Promise<Response | { status: number }> {
const coreConfigs: Array<{ name: string; value: any }> = [];
const calendarConfigs: Array<{ name: string; value: any }> = [];
const esnCalendarConfigs: Array<{ name: string; value: any }> = [];
if (updates.language !== undefined) {
coreConfigs.push({ name: "language", value: updates.language });
@@ -69,6 +71,12 @@ export async function updateUserConfigurations(
value: updates.alarmEmails,
});
}
if (updates.hideDeclinedEvents !== undefined) {
esnCalendarConfigs.push({
name: "hideDeclinedEvents",
value: updates.hideDeclinedEvents,
});
}
const modules: Array<{
name: string;
@@ -88,6 +96,12 @@ export async function updateUserConfigurations(
configurations: calendarConfigs,
});
}
if (esnCalendarConfigs.length > 0) {
modules.push({
name: "linagora.esn.calendar",
configurations: esnCalendarConfigs,
});
}
if (modules.length === 0) {
return Promise.resolve({ status: 204 });