Overview
useUpdateRule returns a callable function for updating a rule’s title or description. Only space admins can update rules.
Usage Example
import { useUpdateRule } from "@replyke/react-js";
function EditRuleForm({ spaceId, ruleId }: { spaceId: string; ruleId: string }) {
const updateRule = useUpdateRule();
const handleSave = async (title: string, description: string) => {
const updated = await updateRule({ spaceId, ruleId, update: { title, description } });
console.log("Updated:", updated.title);
};
}
Parameters
UUID of the rule to update.
Object containing the fields to update. All fields are optional.
Updated description. Pass null to clear.
Returns
The updated Rule object.