Separate API, proc

This commit is contained in:
oitsjustjose 2023-04-22 23:46:37 -05:00
commit 6a3f531527
27 changed files with 334 additions and 104 deletions

View file

@ -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 {

View file

@ -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),
});