Updates an earning rule.
Supports partial updates.
Revision number, which increments by 1 each time the earning rule is updated. To prevent conflicting changes, the current revision must be passed when updating the earning rule.
function updateLoyaltyEarningRule(
_id: string,
earningRule: UpdateLoyaltyEarningRule,
): Promise<UpdateLoyaltyEarningRuleResponse>;
Loyalty earning rule ID.
import { earningRules } from "@wix/loyalty";
async function updateLoyaltyEarningRule(id, earningRule) {
const response = await earningRules.updateLoyaltyEarningRule(id, earningRule);
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.