From e221e0156b9221429f720e697777c36949430367 Mon Sep 17 00:00:00 2001 From: Sven Czarnian Date: Fri, 4 Nov 2022 13:14:19 +0100 Subject: [PATCH] define the user in the types --- src/contexts/authcontext.tsx | 8 +------- src/types/index.ts | 7 +++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/contexts/authcontext.tsx b/src/contexts/authcontext.tsx index 6d0ae33..cdaacc5 100644 --- a/src/contexts/authcontext.tsx +++ b/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 }; diff --git a/src/types/index.ts b/src/types/index.ts index 6784cc1..c05c561 100644 --- a/src/types/index.ts +++ b/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[]; +};