Files
spoolman2/client/src/pages/spools/functions.ts
Donkie bc32f1e890 Now supports running under a sub path
Just set the SPOOLMAN_BASE_PATH environment variable and it should work.

Resolves #95
2024-05-10 11:37:09 +02:00

17 lines
435 B
TypeScript

import { getAPIURL } from "../../utils/url";
import { ISpool } from "./model";
export async function setSpoolArchived(spool: ISpool, archived: boolean) {
const init: RequestInit = {
method: "PATCH",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
archived: archived,
}),
};
const request = new Request(getAPIURL() + "/spool/" + spool.id);
await fetch(request, init);
}