import { request } from "@/components/service/index";
import { WorkflowStep } from "@/components/models/management/WorkflowStep";
import { WorkflowSearch } from "@/components/models/management/Workflow";
export const WorkflowStepService = {
  add: (payload: WorkflowStep) => {
    return request.post("/api/workflow-steps", payload);
  },
  getAll: (params?: Record<string, any>) => {
    return request.get("/api/workflow-steps", { params });
  },
  delete: (id: number) => {
    return request.delete(`/api/workflow-steps/${id}`, {});
  },
  view: (id: number) => {
    return request.get(`/api/workflow-steps/${id}`, {});
  },
  update: (id: number, payload: WorkflowStep) => {
    return request.put(`/api/workflow-steps/${id}`, payload);
  },
  search: (payload: WorkflowSearch) => {
    return request.get("/api/workflow-steps/search", payload);
  },
};
