Added support for application statuses

This commit is contained in:
2025-08-17 20:27:51 -04:00
parent 84207fd6d8
commit 039534b6f9
3 changed files with 32 additions and 8 deletions

View File

@@ -20,6 +20,12 @@ type ApplicationFull = Partial<{
messages: object[]
}>
export enum Status {
Pending = "Pending",
Approved = "Approved",
Denied = "Denied",
}
const addr = "localhost:3000"
export async function loadApplication(): Promise<ApplicationFull | null> {
@@ -32,10 +38,15 @@ export async function loadApplication(): Promise<ApplicationFull | null> {
}
export async function postApplication(val: any) {
let out = {
"App": val,
"Status": Status.Pending
}
await fetch(`http://${addr}/application`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(val),
body: JSON.stringify(out),
})
}