Explorar o código

define the user in the types

Sven Czarnian %!s(int64=2) %!d(string=hai) anos
pai
achega
e221e0156b
Modificáronse 2 ficheiros con 8 adicións e 7 borrados
  1. 1 7
      src/contexts/authcontext.tsx
  2. 7 0
      src/types/index.ts

+ 1 - 7
src/contexts/authcontext.tsx

@@ -2,13 +2,7 @@ import axios from 'axios';
 import { createContext, Dispatch, SetStateAction, useEffect, useState } from 'react';
 import { useNavigate } from 'react-router-dom';
 import { Configuration } from '../services';
-
-export interface User {
-  vatsimId: string;
-  fullName: string;
-  administrator: boolean;
-  airportConfigurationAccess: string[];
-};
+import { User } from '../types';
 
 const AuthContext = createContext<{
   auth: { valid: boolean; user: User };

+ 7 - 0
src/types/index.ts

@@ -3,3 +3,10 @@ export interface AirportOverview {
   name: string;
   flightInformationRegion: string;
 };
+
+export interface User {
+  vatsimId: string;
+  fullName: string;
+  administrator: boolean;
+  airportConfigurationAccess: string[];
+};