use some status information to handle errors better

This commit is contained in:
Sven Czarnian
2022-11-05 00:10:27 +01:00
parent 47c09f2fdd
commit df0a6ade57
6 changed files with 107 additions and 24 deletions

View File

@@ -1,9 +1,20 @@
export enum BackendReturnStatus {
Ok,
Unauthorized,
Failure,
};
export interface AirportOverview {
icao: string;
name: string;
flightInformationRegion: string;
};
export interface AirportOverviewBackend {
status: BackendReturnStatus;
airports: AirportOverview[];
};
export interface User {
vatsimId: string;
fullName: string;
@@ -12,6 +23,19 @@ export interface User {
airportConfigurationAccess: string[];
};
export const DefaultUser: User = {
vatsimId: '',
fullName: '',
radarScopeKey: '',
administrator: false,
airportConfigurationAccess: [],
};
export interface UserBackend {
status: BackendReturnStatus;
user: User;
}
export interface IAuthState {
valid: boolean,
user: User,