2020-11-20 10:32:17 +01:00
|
|
|
import { collection, get, post, del } from '../helpers/request.ts';
|
2020-05-19 15:53:01 +02:00
|
|
|
|
|
|
|
|
const base = 'pages/';
|
|
|
|
|
|
|
|
|
|
export default {
|
2020-11-20 10:32:17 +01:00
|
|
|
...collection(base),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
getAllowedPageTypes: async parent => await get(base + 'getAllowedPageTypes', { params: { parent } }),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
getPageType: async alias => await get(base + 'getPageType', { params: { alias } }),
|
2020-07-08 13:59:46 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
getEmpty: async (type, parent) => await get(base + 'getEmpty', { params: { type, parent } }),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
getRevisions: async (id, page) => await get(base + 'getRevisions', { params: { id, page } }),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
saveSorting: async ids => await post(base + 'saveSorting', ids),
|
2020-10-29 21:44:22 +01:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
move: async (id, destinationId) => await post(base + 'move', { id, destinationId }),
|
2020-08-17 13:23:50 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
copy: async (id, destinationId, includeDescendants) => await post(base + 'copy', { id, destinationId, includeDescendants }),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 10:32:17 +01:00
|
|
|
restore: async (id, includeDescendants) => await post(base + 'restore', { id, includeDescendants }),
|
2020-05-19 15:53:01 +02:00
|
|
|
|
2020-11-20 15:17:41 +01:00
|
|
|
delete: async (id, moveToRecycleBin) => await del(base + 'delete', { params: { id, moveToRecycleBin } }),
|
2020-05-19 15:53:01 +02:00
|
|
|
};
|