mirror of
https://github.com/fosrl/pangolin.git
synced 2025-07-29 15:14:56 +02:00
Get new api endpoints working
This commit is contained in:
parent
6e1bfdac58
commit
b1f4971f25
13 changed files with 79 additions and 51 deletions
|
@ -12,9 +12,12 @@ interface PeerBandwidth {
|
|||
|
||||
export const handleReceiveBandwidthMessage: MessageHandler = async (context) => {
|
||||
const { message, client, sendToClient } = context;
|
||||
const newt = client as Newt;
|
||||
|
||||
const bandwidthData: PeerBandwidth[] = message.data;
|
||||
if (!message.data.bandwidthData) {
|
||||
logger.warn("No bandwidth data provided");
|
||||
}
|
||||
|
||||
const bandwidthData: PeerBandwidth[] = message.data.bandwidthData;
|
||||
|
||||
if (!Array.isArray(bandwidthData)) {
|
||||
throw new Error("Invalid bandwidth data");
|
||||
|
@ -63,6 +66,4 @@ export const handleReceiveBandwidthMessage: MessageHandler = async (context) =>
|
|||
.where(eq(clients.clientId, client.clientId));
|
||||
}
|
||||
});
|
||||
|
||||
logger.info("Handling register olm message!");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue