> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: updateRule(_id: string, rule: UpdateRule, options: UpdateRuleOptions) # Method package: wixRestaurantsV2 # Method menu location: wixRestaurantsV2 --> serviceFees --> updateRule # Method Link: https://dev.wix.com/docs/velo/apis/wix-restaurants-v2/service-fees/update-rule.md # Method Description: The `updateRule()` function returns a Promise that resolves to the updated rule. Each time the task is updated, `revision` increments by 1. The existing `revision` must be included when updating the task. This ensures you're working with the latest task and prevents unintended overwrites. To update multiple rules at once, use the `bulkUpdateRules()` function. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## updateRule example for dashboard page code ```javascript import { serviceFees } from 'wix-restaurants.v2'; async function updateRule(id, rule, options) { try { const result = await serviceFees.updateRule(id, rule, options); return result; } catch (error) { console.error(error); // Handle the error } } ``` ## updateRule example for exporting from backend code ```javascript import { serviceFees } from 'wix-restaurants.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedUpdateRule = elevate(serviceFees.updateRule); export const updateRule = webMethod( Permissions.Anyone, async (id, rule, options) => { try { const result = await elevatedUpdateRule(id, rule, options); return result; } catch (error) { console.error(error); // Handle the error } } ); ``` ---