API integration stuff
This commit is contained in:
@@ -15,10 +15,44 @@ export type ApplicationDto = Partial<{
|
||||
aknowledgeRules: boolean
|
||||
}>
|
||||
|
||||
type ApplicationFull = Partial<{
|
||||
app: ApplicationDto,
|
||||
messages: object[]
|
||||
}>
|
||||
export interface ApplicationData {
|
||||
dob: string;
|
||||
name: string;
|
||||
playtime: number;
|
||||
hobbies: string;
|
||||
military: boolean;
|
||||
communities: string;
|
||||
joinReason: string;
|
||||
milsimAttraction: string;
|
||||
referral: string;
|
||||
steamProfile: string;
|
||||
timezone: string;
|
||||
canAttendSaturday: boolean;
|
||||
interests: string;
|
||||
aknowledgeRules: boolean;
|
||||
}
|
||||
|
||||
export interface ApplicationRow {
|
||||
id: number;
|
||||
member_id: number;
|
||||
app_version: number;
|
||||
app_data: ApplicationData;
|
||||
|
||||
submitted_at: string; // ISO datetime from DB (e.g., "2025-08-25T18:04:29.000Z")
|
||||
updated_at: string | null;
|
||||
approved_at: string | null;
|
||||
denied_at: string | null;
|
||||
|
||||
app_status: Status; // generated column
|
||||
decision_at: string | null; // generated column
|
||||
|
||||
// present when you join members (e.g., SELECT a.*, m.name AS member_name)
|
||||
member_name: string;
|
||||
}
|
||||
|
||||
export type ApplicationFull = ApplicationRow & {
|
||||
messages?: object[];
|
||||
};
|
||||
|
||||
export enum Status {
|
||||
Pending = "Pending",
|
||||
@@ -68,7 +102,7 @@ export async function getAllApplications() {
|
||||
const res = await fetch(`http://${addr}/application/all`)
|
||||
|
||||
if (res.ok) {
|
||||
return await res.json();
|
||||
return res.json()
|
||||
} else {
|
||||
console.error("Something went wrong approving the application")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user