> 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: updateCategory(_id: string, category: UpdateCategory) # Method package: wixEventsV2 # Method menu location: wixEventsV2 --> categories --> updateCategory # Method Link: https://dev.wix.com/docs/velo/apis/wix-events-v2/categories/update-category.md # Method Description: Updates an existing category. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Update a category (export from backend code) ```javascript import { categories } from 'wix-events.v2'; import { webMethod, Permissions } from 'wix-web-module'; import { elevate } from 'wix-auth'; const elevatedUpdateCategory = elevate(categories.updateCategory); /* * Sample _id value: "6ec293a8-1b47-4337-9c4e-9a6aeb35e66a" * Sample category value: * { * "name": "workshop-leather" * } */ export const myUpdateCategoryFunction = webMethod( Permissions.Anyone, async (_id, category) => { try { const updatedCategory = await elevatedUpdateCategory(_id, category); console.log('Updated category: ', updatedCategory); return updatedCategory; } catch (error) { console.error(error); // Handle the error } } ); /* Promise resolves to: * { * "name": "workshop-leather", * "states": [ * "MANUAL" * ], * "_id": "6ec293a8-1b47-4337-9c4e-9a6aeb35e66a", * "_createdDate": "2022-12-13T11:03:19.174Z" * } */ ``` ## Update a category (dashboard page code) ```javascript import { categories } from 'wix-events.v2'; /* * Sample _id value: "6ec293a8-1b47-4337-9c4e-9a6aeb35e66a" * Sample category value: * { * "name": "workshop-leather" * } */ export async function myUpdateCategoryFunction(_id, category) { try { const updatedCategory = await categories.updateCategory(_id, category); console.log('Updated category: ', updatedCategory); return updatedCategory; } catch (error) { console.error(error); // Handle the error } } /* Promise resolves to: * { * "name": "workshop-leather", * "states": [ * "MANUAL" * ], * "_id": "6ec293a8-1b47-4337-9c4e-9a6aeb35e66a", * "_createdDate": "2022-12-13T11:03:19.174Z" * } */ ``` ---