mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
feat: add admin updates page with release history
Shows bot and cabinet releases with version badges, changelogs, and update detection via __APP_VERSION__.
This commit is contained in:
32
src/api/adminUpdates.ts
Normal file
32
src/api/adminUpdates.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import apiClient from './client';
|
||||
|
||||
// ============ Types ============
|
||||
|
||||
export interface ReleaseItem {
|
||||
tag_name: string;
|
||||
name: string;
|
||||
body: string;
|
||||
published_at: string;
|
||||
prerelease: boolean;
|
||||
}
|
||||
|
||||
export interface ProjectReleasesInfo {
|
||||
current_version: string;
|
||||
has_updates: boolean;
|
||||
releases: ReleaseItem[];
|
||||
repo_url: string;
|
||||
}
|
||||
|
||||
export interface ReleasesResponse {
|
||||
bot: ProjectReleasesInfo;
|
||||
cabinet: ProjectReleasesInfo;
|
||||
}
|
||||
|
||||
// ============ API ============
|
||||
|
||||
export const adminUpdatesApi = {
|
||||
getReleases: async (): Promise<ReleasesResponse> => {
|
||||
const response = await apiClient.get('/cabinet/admin/updates/releases');
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user