- Added API routes for fetching connected users, keywords, missions, and stations. - Created a new QueryProvider component for managing query states and socket events. - Introduced connection stores for dispatch and pilot, managing socket connections and states. - Updated Prisma schema for connected aircraft model. - Enhanced UI with toast notifications for status updates and chat interactions. - Implemented query functions for fetching connected users and keywords with error handling.
15 lines
363 B
TypeScript
15 lines
363 B
TypeScript
import { Prisma, Station } from "@repo/db";
|
|
import axios from "axios";
|
|
|
|
export const getStationsAPI = async (filter?: Prisma.StationWhereInput) => {
|
|
const res = await axios.get<Station[]>("/api/stations", {
|
|
params: {
|
|
filter: JSON.stringify(filter),
|
|
},
|
|
});
|
|
if (res.status !== 200) {
|
|
throw new Error("Failed to fetch stations");
|
|
}
|
|
return res.data;
|
|
};
|