feat(ui): new WorkflowRuns using antd
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import { type WorkflowRunLog } from "@/domain/workflow";
|
||||
import { type WorkflowRunModel } from "@/domain/workflowRun";
|
||||
import { getPocketBase } from "./pocketbase";
|
||||
|
||||
const COLLECTION_NAME = "workflow_run_log";
|
||||
|
||||
export type ListWorkflowLogsRequest = {
|
||||
id: string;
|
||||
export type ListWorkflowRunsRequest = {
|
||||
workflowId: string;
|
||||
page?: number;
|
||||
perPage?: number;
|
||||
};
|
||||
|
||||
export const list = async (request: ListWorkflowLogsRequest) => {
|
||||
export const list = async (request: ListWorkflowRunsRequest) => {
|
||||
const page = request.page || 1;
|
||||
const perPage = request.perPage || 10;
|
||||
|
||||
return await getPocketBase()
|
||||
.collection(COLLECTION_NAME)
|
||||
.getList<WorkflowRunLog>(page, perPage, {
|
||||
filter: getPocketBase().filter("workflow={:workflowId}", { workflowId: request.id }),
|
||||
.getList<WorkflowRunModel>(page, perPage, {
|
||||
filter: getPocketBase().filter("workflow={:workflowId}", { workflowId: request.workflowId }),
|
||||
sort: "-created",
|
||||
requestKey: null,
|
||||
});
|
||||
Reference in New Issue
Block a user