mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-03-02 11:58:56 +00:00
render channel list dynamically based on channel activity
This commit is contained in:
22
data/channels.ts
Normal file
22
data/channels.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import axios from "axios";
|
||||
|
||||
export interface Channel {
|
||||
id: string;
|
||||
name: string;
|
||||
topic: string;
|
||||
num_members: number;
|
||||
purpose: {
|
||||
value: string;
|
||||
creator: string;
|
||||
last_set: number;
|
||||
};
|
||||
messages_today: number;
|
||||
unique_members_today: number;
|
||||
}
|
||||
|
||||
export async function getChannels() {
|
||||
const response = await axios.get<Channel[]>(
|
||||
"http://stats.koodiklinikka.fi/api/channels"
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
Reference in New Issue
Block a user