Implemented self extension
This commit is contained in:
@@ -169,6 +169,23 @@ export async function extendLOA(id: number, to: Date) {
|
||||
}
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
return
|
||||
} else {
|
||||
throw new Error("Could not extend LOA");
|
||||
}
|
||||
}
|
||||
|
||||
export async function adminExtendLOA(id: number, to: Date) {
|
||||
const res = await fetch(`${addr}/loa/extendAdmin/${id}`, {
|
||||
method: "POST",
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ to }),
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
}
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
return
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user