12345678910111213141516171819 |
- import axios from 'axios';
- import { Configuration } from './configuration';
- import { AirportOverview } from '../types';
- export class Airport {
- static async all(): Promise<AirportOverview[]> {
- const token = sessionStorage.getItem('token');
- if (!token) return [];
- return axios
- .get<AirportOverview[]>(`${Configuration.resourceServer}/airport/all`, {
- headers: {
- Authorization: `Bearer ${token}`,
- },
- })
- .then((response) => response.data)
- .catch(() => []);
- }
- }
|