use some status information to handle errors better
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user