reaminig 5-t-9
This commit is contained in:
@@ -56,6 +56,27 @@ export const builderApi = {
|
||||
const res = await client.get(`/pages/?site_blueprint=${blueprintId}`);
|
||||
return Array.isArray(res.data?.results) ? res.data.results : res.data;
|
||||
},
|
||||
|
||||
async generateAllPages(
|
||||
blueprintId: number,
|
||||
options?: { pageIds?: number[]; force?: boolean },
|
||||
): Promise<{ success: boolean; pages_queued: number; task_ids: number[]; celery_task_id?: string }> {
|
||||
const res = await client.post(`/blueprints/${blueprintId}/generate_all_pages/`, {
|
||||
page_ids: options?.pageIds,
|
||||
force: options?.force || false,
|
||||
});
|
||||
return res.data?.data || res.data;
|
||||
},
|
||||
|
||||
async createTasksForPages(
|
||||
blueprintId: number,
|
||||
pageIds?: number[],
|
||||
): Promise<{ tasks: unknown[]; count: number }> {
|
||||
const res = await client.post(`/blueprints/${blueprintId}/create_tasks/`, {
|
||||
page_ids: pageIds,
|
||||
});
|
||||
return res.data?.data || res.data;
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user