mirror of
https://github.com/Nezumi-2711/cloudflare-gateway-pihole-scripts.git
synced 2026-09-22 13:38:37 +00:00
refactored rule deletion
This commit is contained in:
+18
-1
@@ -127,10 +127,17 @@ export const deleteZeroTrustListsAtOnce = async (lists) => {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets Zero Trust rules.
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
export const getZeroTrustRules = () =>
|
||||
requestGateway("/rules", { method: "GET" });
|
||||
|
||||
/**
|
||||
* Creates a Zero Trust rule.
|
||||
* @param {string} wirefilterExpression The expression to be used for the rule.
|
||||
* @returns {Promise<any>}
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
export const createZeroTrustRule = (wirefilterExpression) =>
|
||||
requestGateway("/rules", {
|
||||
@@ -145,3 +152,13 @@ export const createZeroTrustRule = (wirefilterExpression) =>
|
||||
traffic: wirefilterExpression,
|
||||
}),
|
||||
});
|
||||
|
||||
/**
|
||||
* Deletes a Zero Trust rule.
|
||||
* @param {number} id The ID of the rule to be deleted.
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
export const deleteZeroTrustRule = (id) =>
|
||||
requestGateway(`/rules/${id}`, {
|
||||
method: "DELETE",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user