mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Draw commit boundaries in the new map.
https://github.com/dcs-liberation/dcs_liberation/issues/2039
This commit is contained in:
16
client/src/api/api.ts
Normal file
16
client/src/api/api.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { HTTP_URL } from "./backend";
|
||||
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
|
||||
import { LatLng } from "leaflet";
|
||||
|
||||
// TODO: We should be auto-generating this from FastAPI's openapi.json.
|
||||
export const apiSlice = createApi({
|
||||
reducerPath: "api",
|
||||
baseQuery: fetchBaseQuery({ baseUrl: HTTP_URL }),
|
||||
endpoints: (builder) => ({
|
||||
getCommitBoundaryForFlight: builder.query<LatLng[], string>({
|
||||
query: (flightId) => `flights/${flightId}/commit-boundary`,
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
export const { useGetCommitBoundaryForFlightQuery } = apiSlice;
|
||||
@@ -1,7 +1,9 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const HTTP_URL = "http://[::1]:5000/";
|
||||
|
||||
export const backend = axios.create({
|
||||
baseURL: "http://[::1]:5000/",
|
||||
baseURL: HTTP_URL,
|
||||
});
|
||||
|
||||
export const WEBSOCKET_URL = "ws://[::1]:5000/eventstream";
|
||||
|
||||
Reference in New Issue
Block a user