feat: adding openapi spect generation to the frontend client aas well as to fast api. Broke API out into different routes

This commit is contained in:
lucas.oskorep
2023-07-17 02:51:13 -04:00
parent 4a20152ff5
commit 9aa9122e2b
35 changed files with 1132 additions and 27146 deletions

View File

@@ -1,13 +1,4 @@
import {MtaData, MtaStartTime} from "@/services/mta-api/types";
export const fetchStationData = async (stations: [string]): Promise<MtaData> => {
const res = await fetch("/api/mta", {method: "POST"})
const data = await res.json()
return {
mtaData: data
};
};
import { MtaStartTime} from "@/services/mta-api/types";
export const fetchStartDate = async (stations: [string]): Promise<MtaStartTime> => {
const res = await fetch("/api/start_time", {method: "POST"})

View File

@@ -1,7 +1,11 @@
export interface MtaData {
mtaData: any;
}
import {Configuration, MtaDataApi} from "@/gen-sources/mta-sign-api"
export interface MtaStartTime {
startTime: Date
}
}
export const mtaApiConfiguration = new Configuration(
{basePath:"http://localhost:8000"}
)
export const mtaDataClient = new MtaDataApi(mtaApiConfiguration);