mirror of https://github.com/portainer/portainer
17 lines
428 B
TypeScript
17 lines
428 B
TypeScript
|
import axios, { parseAxiosError } from '@/portainer/services/axios';
|
||
|
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||
|
|
||
|
export async function deleteJob(
|
||
|
environmentId: EnvironmentId,
|
||
|
jobId: string,
|
||
|
namespace: string
|
||
|
) {
|
||
|
try {
|
||
|
await axios.delete(`/nomad/endpoints/${environmentId}/jobs/${jobId}`, {
|
||
|
params: { namespace },
|
||
|
});
|
||
|
} catch (e) {
|
||
|
throw parseAxiosError(e as Error);
|
||
|
}
|
||
|
}
|