mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-25 21:00:49 +08:00
24 lines
513 B
TypeScript
24 lines
513 B
TypeScript
import { ClientResponseError } from "pocketbase";
|
|
|
|
import { getPocketBase } from "@/repository/pocketbase";
|
|
|
|
export const run = async (id: string) => {
|
|
const pb = getPocketBase();
|
|
|
|
const resp = await pb.send("/api/workflow/run", {
|
|
method: "POST",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
body: {
|
|
id,
|
|
},
|
|
});
|
|
|
|
if (resp.status != 0 && resp.status !== 200) {
|
|
throw new ClientResponseError({ status: resp.status, response: resp, data: {} });
|
|
}
|
|
|
|
return resp;
|
|
};
|