implemented connectedDispatch record for dispatcher
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { ConnectedAircraft, ConnectedDispatcher } from "@repo/db";
|
||||
import axios from "axios";
|
||||
|
||||
export const serverApi = axios.create({
|
||||
@@ -7,3 +8,15 @@ export const serverApi = axios.create({
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
export const getConenctedUsers = async (): Promise<
|
||||
(ConnectedDispatcher | ConnectedAircraft)[]
|
||||
> => {
|
||||
const res = await serverApi.get<(ConnectedDispatcher | ConnectedAircraft)[]>(
|
||||
"/status/connected-users",
|
||||
);
|
||||
if (res.status !== 200) {
|
||||
throw new Error("Failed to fetch connected users");
|
||||
}
|
||||
return res.data;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user