mirror of
https://github.com/MeshCore-Beacon/beacon-web.git
synced 2026-09-09 15:05:34 +00:00
fix channels tab crashing on page-wrapped API response
This commit is contained in:
+6
-4
@@ -59,21 +59,23 @@ export function getIatas(): Promise<IataCode[]> {
|
||||
return request("/iatas");
|
||||
}
|
||||
|
||||
export function getChannels(params?: { iata?: string; limit?: number }): Promise<ChannelSummary[]> {
|
||||
return request("/channels", {
|
||||
export async function getChannels(params?: { iata?: string; limit?: number }): Promise<ChannelSummary[]> {
|
||||
const page = await request<{ items: ChannelSummary[] }>("/channels", {
|
||||
iata: params?.iata,
|
||||
limit: params?.limit,
|
||||
});
|
||||
return page.items;
|
||||
}
|
||||
|
||||
export function getChannelMessages(
|
||||
export async function getChannelMessages(
|
||||
channelId: number,
|
||||
params?: { iata?: string; limit?: number },
|
||||
): Promise<ChannelMessage[]> {
|
||||
return request(`/channels/${channelId}/messages`, {
|
||||
const page = await request<{ items: ChannelMessage[] }>(`/channels/${channelId}/messages`, {
|
||||
iata: params?.iata,
|
||||
limit: params?.limit ?? DEFAULT_PAGE_SIZE,
|
||||
});
|
||||
return page.items;
|
||||
}
|
||||
|
||||
export function getBrokers(): Promise<BrokerStatus[]> {
|
||||
|
||||
Reference in New Issue
Block a user