-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b676b8
commit 5ccab7c
Showing
3 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import axios, { handleAxiosError } from "./axios"; | ||
|
||
export const createProcessingJob = ( | ||
jobType: string, | ||
jobPayload: Record<string, any> | ||
): Promise<string> => { | ||
const payload = { | ||
jobType, | ||
TmtvJob: jobPayload, | ||
}; | ||
|
||
return axios | ||
.post(`/api/processing`, payload) | ||
.then((response) => response.data.JobId) | ||
.catch(handleAxiosError); | ||
}; | ||
|
||
export const getProcessingJob = (jobId: string): Promise<string> => { | ||
return axios | ||
.get(`/api/processing/` + jobId) | ||
.then((response) => response.data.JobId) | ||
.catch(handleAxiosError); | ||
}; | ||
|
||
|
||
export const deleteProcessingJob = (jobId: string): Promise<void> => { | ||
return axios | ||
.delete(`/api/processing/` + jobId) | ||
.then((response) => undefined) | ||
.catch(handleAxiosError); | ||
}; |