Implemented admin assign unit UI
All checks were successful
Pull Request CI / Merge Check (pull_request) Successful in 3m55s

This commit is contained in:
2026-03-02 20:16:28 -05:00
parent 54dcb9d389
commit a988545dda
7 changed files with 278 additions and 5 deletions

View File

@@ -12,4 +12,15 @@ export async function getUnits(): Promise<Unit[]> {
throw new Error("Failed to fetch units");
}
return response.json();
}
export async function adminAssignUnit(member: number, unit: number, reason: string) {
const response = await fetch(`${addr}/memberUnits/admin?memberId=${member}&unitId=${unit}&reason=${encodeURIComponent(reason)}`, {
method: 'POST',
credentials: 'include'
});
if (!response.ok) {
throw new Error("Failed to assign unit");
}
return;
}