feat: add backgroundJobs endpoint

This commit is contained in:
Matthias 2024-11-20 20:06:20 +01:00
parent 67a9615347
commit 72f2b6d6d8

View File

@ -696,6 +696,15 @@ export function createBotSubStore(botId: string, botName: string) {
return Promise.reject(error); return Promise.reject(error);
} }
}, },
async getBackgroundJobs() {
try {
const { data } = await api.get<BackgroundTaskStatus[]>('/background');
return Promise.resolve(data);
} catch (error) {
console.error(error);
return Promise.reject(error);
}
},
async getBackgroundJobStatus(jobId: string) { async getBackgroundJobStatus(jobId: string) {
try { try {
const { data } = await api.get<BackgroundTaskStatus>(`/background/${jobId}`); const { data } = await api.get<BackgroundTaskStatus>(`/background/${jobId}`);