diff --git a/client/src/components/Dashboard/Flights/Flights.tsx b/client/src/components/Dashboard/Flights/Flights.tsx index 20a824586fb6cb3f60a58c04614413bd58160548..3b9eab3c508782690369f454d814e1e580743d05 100644 --- a/client/src/components/Dashboard/Flights/Flights.tsx +++ b/client/src/components/Dashboard/Flights/Flights.tsx @@ -49,7 +49,7 @@ function Flights() { <> <div className='flights'> <div className='flex-row'> - <span className='flights-title'>Flights List</span> + <span className='flights-title'>Flight List</span> <Link to="/register-flight"> <button type='button' className='view-more'>Add flight</button> </Link> diff --git a/client/src/services/Dashboard/AirlineDashboard.ts b/client/src/services/Dashboard/AirlineDashboard.ts index b0e1dda10fcbd384fa1f04b9c69cee1bcdb3abdf..a68f201aa5f4f81331961444d0671b9c15c0d0da 100644 --- a/client/src/services/Dashboard/AirlineDashboard.ts +++ b/client/src/services/Dashboard/AirlineDashboard.ts @@ -1,30 +1,6 @@ import Api from "../../helpers/Api"; -import UserStorage from "../../helpers/UserStorage"; - -export interface ISeat { - id: number; - classType: number; - seatNumber: string; - isAvailable: boolean; -} - -export interface ISeats { - $id: string; - $values: ISeat[]; -} - -export interface IFlight { - id: number; - origin: string; - destination: string; - arrivalTime: string; - departureTime: string; - economyCapacity: number; - businessCapacity: number; - economyPrice: number; - businessPrice: number; - seats: ISeats -} +import { getSearchParam } from "../../helpers/SearchParams"; +import { IFlight } from "./CustomerDashboard"; export interface IAirlineDashboardData { type: 'airline' diff --git a/client/src/services/Dashboard/CustomerDashboard.ts b/client/src/services/Dashboard/CustomerDashboard.ts index f3bd27c8e7195f72796ed63c9cf61d635b468be2..307d171a0e019ae07ac8ec28c2198d21a49a35f5 100644 --- a/client/src/services/Dashboard/CustomerDashboard.ts +++ b/client/src/services/Dashboard/CustomerDashboard.ts @@ -1,4 +1,5 @@ import Api from "../../helpers/Api"; +import { getSearchParam } from "../../helpers/SearchParams"; export interface ISeat { id: number; @@ -33,8 +34,8 @@ export interface ICustomerDashboardData { export async function GetCustomerDashboardData(): Promise<ICustomerDashboardData> { try { - const upcomingFlights = Api.get('Booking/upcoming', { withCredentials: true }); - const flightsHistory = Api.get('Booking/history', { withCredentials: true }); + const upcomingFlights = Api.get('Booking/upcoming', {withCredentials: true}); + const flightsHistory = Api.get('Booking/history', {withCredentials: true}); const [uData, hData] = await Promise.all([upcomingFlights, flightsHistory]); return {