Added support for application statuses
This commit is contained in:
@@ -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),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user