mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-08-18 08:27:14 +02:00
add auto remove orphans
fix orphans in dynamic groups not included Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user