Separate API, proc
This commit is contained in:
parent
c1f1742948
commit
6a3f531527
27 changed files with 334 additions and 104 deletions
|
|
@ -5,7 +5,7 @@ export default ({ id }) => {
|
|||
|
||||
useEffect(() => {
|
||||
const handle = setInterval(async () => {
|
||||
const resp = await fetch(`/jobs/status/${id}`);
|
||||
const resp = await fetch(`/api/v1/jobs/${id}`, { method: 'POST' });
|
||||
if (resp.ok) {
|
||||
setLogs(await resp.text());
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ export default () => {
|
|||
evt.preventDefault();
|
||||
if (!isValidState()) return;
|
||||
|
||||
const resp = await fetch('/jobs/new', {
|
||||
method: 'POST',
|
||||
const resp = await fetch('/api/v1/jobs', {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(formData),
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue