add auto remove orphans

fix orphans in dynamic groups not included

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-03-29 16:30:01 +02:00
parent 8fa58ded8f
commit 83f9e8f279
21 changed files with 721 additions and 54 deletions
+45
View File
@@ -1241,6 +1241,30 @@ export class API {
*/
delete: async (id) => {
return await deleteJSON(this.getPath(`/company/${id}`));
},
/**
* Get the auto-prune orphaned recipients setting for a company.
* Returns only the per-company enabled flag.
*
* @param {string} id - company ID
* @returns {Promise<ApiResponse>}
*/
getAutoPrune: async (id) => {
return await getJSON(this.getPath(`/company/${id}/option/auto-prune`));
},
/**
* Set the auto-prune orphaned recipients setting for a company.
*
* @param {string} id - company ID
* @param {boolean} enabled
* @returns {Promise<ApiResponse>}
*/
setAutoPrune: async (id, enabled) => {
return await postJSON(this.getPath(`/company/${id}/option/auto-prune`), {
enabled: enabled
});
}
};
@@ -2267,6 +2291,27 @@ export class API {
return await getJSON(this.getPath(`/option/${key}`));
},
/**
* Get the global auto-prune orphaned recipients setting.
* Returns the full option including per-company entries.
*
* @returns {Promise<ApiResponse>}
*/
getAutoPrune: async () => {
return await getJSON(this.getPath(`/option/auto-prune`));
},
/**
* Set the global auto-prune orphaned recipients setting.
* The full option object (including per-company entries) must be supplied.
*
* @param {{ enabled: boolean, companies?: string[] }} option
* @returns {Promise<ApiResponse>}
*/
setAutoPrune: async (option) => {
return await postJSON(this.getPath(`/option/auto-prune`), option);
},
/**
* Set setting by key and value.
*