mirror of
https://github.com/ccmjga/zhilu-admin
synced 2026-03-23 11:23:42 +08:00
25 lines
414 B
TypeScript
25 lines
414 B
TypeScript
import client from "@/api/client";
|
|
|
|
export const useJobUpdate = () => {
|
|
const updateCron = async (trigger: {
|
|
triggerName: string;
|
|
triggerGroup: string;
|
|
cron: string;
|
|
}) => {
|
|
await client.PUT("/scheduler/job/update", {
|
|
params: {
|
|
query: {
|
|
cron: trigger.cron,
|
|
},
|
|
},
|
|
body: {
|
|
name: trigger.triggerName,
|
|
group: trigger.triggerGroup,
|
|
},
|
|
});
|
|
};
|
|
return {
|
|
updateCron,
|
|
};
|
|
};
|