> 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: reorderEventPolicies(policyId: string, eventId: string, options: ReorderEventPoliciesOptions) # Method package: wixEventsV2 # Method menu location: wixEventsV2 --> policies --> reorderEventPolicies # Method Link: https://dev.wix.com/docs/velo/apis/wix-events-v2/policies/reorder-event-policies.md # Method Description: Changes policy order in an event dashboard and agreement checkbox on the checkout form. For example, if we have 3 policies in the list, after using this function the 3rd policy will become the 1st, and other policies will move by 1 position. By default, the policies are arranged by the created date in descending order. > **Note**: it is possible to use both `beforePolicyId` and `afterPolicyId` at the same time but only the last one defined will be executed. The `reorderEventPolicies()` function returns a Promise that resolves to the newly-reordered policy. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Reorder Policies (dashboard page code) ```javascript import { policies } from 'wix-events.v2'; // define event ID and policies to reorder const eventId = '3d3d5c04-ece0-45a8-85f0-11a58edaa192'; const options = { policyId: '52f15c5c-ea06-44f4-866a-b1cfa6f4f790', beforePolicyId: '6933ddf1-26c7-46c3-9924-e78c833d6cca' }; // reorder policies async function elevatedReorderPoliciesFunction(){ const elevatedReorderPolicies = wixAuth.elevate(policies.reorderEventPolicies); try { const result = await elevatedReorderPolicies(eventId, options); return result; } catch (error) { console.error(error); // Handle the error } }; /* Returns a promise that resolves to the reordered policies. { "policies": [ { "_id": "52f15c5c-ea06-44f4-866a-b1cfa6f4f790", "revision": "2", "_createdDate": "2023-03-07T14:15:44.312Z", "_updatedDate": "2023-03-07T14:33:00.876Z", "name": "Terms and Conditions Event 1", "body": "

Tickets to this Event are issued on behalf of the Organiser and are subject to the following terms and conditions.

", "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" }, { "_id": "6933ddf1-26c7-46c3-9924-e78c833d6cca", "revision": "2", "_createdDate": "2023-03-07T13:18:09.185Z", "_updatedDate": "2023-03-07T14:33:01.072Z", "name": "Terms and Conditions Event 2", "body": "

Nobody will be allowed admission to the Event without a valid ticket or pass.

", "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" }, { "_id": "b9d5f876-f961-497a-9f30-9edae95d8f87", "revision": "1", "_createdDate": "2023-03-07T14:16:25.452Z", "_updatedDate": "2023-03-07T14:16:25.452Z", "name": "Terms and Conditions Event 3", "body": "

All tickets or passes should be checked on purchase, as mistakes cannot always be rectified.

", "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" } ] } */ ``` ## Reorder Policies (export from backend code) ```javascript import { Permissions, webMethod } from 'wix-web-module'; import { policies } from 'wix-events.v2'; import { elevate } from 'wix-auth'; // define event ID and policies to reorder const eventId = '3d3d5c04-ece0-45a8-85f0-11a58edaa192'; const options = { policyId: '52f15c5c-ea06-44f4-866a-b1cfa6f4f790', beforePolicyId: '6933ddf1-26c7-46c3-9924-e78c833d6cca' }; export const elevatedReorderPoliciesFunction = webMethod(Permissions.Anyone, async () => { const elevatedReorderPolicies = elevate(policies.reorderEventPolicies); try { const result = await elevatedReorderPolicies(eventId, options); return result; } catch (error) { console.error(error); // Handle the error } }); /* Promise resolves to: * { * "policies": [ * { * "_id": "52f15c5c-ea06-44f4-866a-b1cfa6f4f790", * "revision": "2", * "_createdDate": "2023-03-07T14:15:44.312Z", * "_updatedDate": "2023-03-07T14:33:00.876Z", * "name": "Terms and Conditions Event 1", * "body": "

Tickets to this Event are issued on behalf of the Organiser and are subject to the following terms and conditions.

", * "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" * }, * { * "_id": "6933ddf1-26c7-46c3-9924-e78c833d6cca", * "revision": "2", * "_createdDate": "2023-03-07T13:18:09.185Z", * "_updatedDate": "2023-03-07T14:33:01.072Z", * "name": "Terms and Conditions Event 2", * "body": "

Nobody will be allowed admission to the Event without a valid ticket or pass.

", * "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" * }, * { * "_id": "b9d5f876-f961-497a-9f30-9edae95d8f87", * "revision": "1", * "_createdDate": "2023-03-07T14:16:25.452Z", * "_updatedDate": "2023-03-07T14:16:25.452Z", * "name": "Terms and Conditions Event 3", * "body": "

All tickets or passes should be checked on purchase, as mistakes cannot always be rectified.

", * "eventId": "3d3d5c04-ece0-45a8-85f0-11a58edaa192" * } * ] * } */ ``` ---