feat(update): add API endpoint to retrieve app version and update client-side calls

This commit is contained in:
t8y2 committed 2026-05-05 16:01:38 +08:00
1 parent 3acd9280ac
commit 24537093ad
6 files changed
+23 -10

No files matched your search

+4
View File
@@ -3,6 +3,10 @@ use dbx_core::update;
use crate::error::AppError;
pub async fn get_version() -> Json<serde_json::Value> {
Json(serde_json::json!({ "version": env!("CARGO_PKG_VERSION") }))
}
pub async fn check_for_updates() -> Result<Json<serde_json::Value>, AppError> {
let release = update::fetch_latest_release().await.map_err(AppError)?;
let info = update::build_update_info(release, env!("CARGO_PKG_VERSION"));