From 58cc9e7337c32e5a0c97d4281991d44e4f7a3025 Mon Sep 17 00:00:00 2001 From: Arshia <arshiapour@hotmail.co.uk> Date: Sat, 20 Apr 2024 03:44:34 +0330 Subject: [PATCH] test --- .../components/Dashboard/Flights/Flights.tsx | 2 +- .../services/Dashboard/AirlineDashboard.ts | 28 ++----------------- .../services/Dashboard/CustomerDashboard.ts | 5 ++-- 3 files changed, 6 insertions(+), 29 deletions(-) diff --git a/client/src/components/Dashboard/Flights/Flights.tsx b/client/src/components/Dashboard/Flights/Flights.tsx index 20a8245..3b9eab3 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 b0e1dda..a68f201 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 f3bd27c..307d171 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 { -- GitLab