17 lines
435 B
TypeScript
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);
|
|
}
|