15 lines
411 B
TypeScript
15 lines
411 B
TypeScript
import { AxiosError } from 'axios'
|
|
import apiService from './api.service'
|
|
|
|
export const generateBackgroundWorkers = async () => {
|
|
try {
|
|
return await apiService.fetchData<void, Record<string, string>>({
|
|
method: 'POST',
|
|
url: '/api/app/background-worker/generate-background-workers',
|
|
})
|
|
} catch (error) {
|
|
if (error instanceof AxiosError) {
|
|
return error.response?.data
|
|
}
|
|
}
|
|
}
|