mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-28 04:27:24 +00:00
Add activities page.
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
ServerConfig,
|
||||
RSort,
|
||||
TagWithCount,
|
||||
Activity,
|
||||
} from "./models.ts";
|
||||
|
||||
class Network {
|
||||
@@ -994,6 +995,18 @@ class Network {
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async getActivities(page: number = 1): Promise<PageResponse<Activity>> {
|
||||
try {
|
||||
const response = await axios.get(`${this.apiBaseUrl}/activity`, {
|
||||
params: { page },
|
||||
});
|
||||
return response.data;
|
||||
} catch (e: any) {
|
||||
console.error(e);
|
||||
return { success: false, message: e.toString() };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const network = new Network();
|
||||
|
Reference in New Issue
Block a user