refactor: remove duplicate api route definitions
This commit is contained in:
committed by
Andrew Phillips (aider)
parent
4f84fdca34
commit
46fff9464f
@@ -1,24 +0,0 @@
|
||||
use axum::{
|
||||
routing::{get, post, delete},
|
||||
Router,
|
||||
};
|
||||
|
||||
use crate::modes::server::common::AppState;
|
||||
use crate::modes::server::api::{
|
||||
item, status
|
||||
};
|
||||
|
||||
pub fn add_routes(router: Router<AppState>) -> Router<AppState> {
|
||||
router
|
||||
// Status endpoints
|
||||
.route("/api/status", get(status::handle_status))
|
||||
|
||||
// Item endpoints
|
||||
.route("/api/item/", get(item::handle_list_items).post(item::handle_post_item))
|
||||
.route("/api/item/latest", get(item::handle_get_item_latest))
|
||||
.route("/api/item/latest/meta", get(item::handle_get_item_latest_meta))
|
||||
.route("/api/item/latest/content", get(item::handle_get_content_latest))
|
||||
.route("/api/item/:id", get(item::handle_get_item).delete(item::handle_delete_item))
|
||||
.route("/api/item/:id/meta", get(item::handle_get_item_meta))
|
||||
.route("/api/item/:id/content", get(item::handle_get_content))
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
use axum::{
|
||||
routing::{get, post, delete},
|
||||
Router,
|
||||
};
|
||||
|
||||
use crate::modes::server::common::AppState;
|
||||
use crate::modes::server::api::{
|
||||
item, status
|
||||
};
|
||||
|
||||
pub fn add_routes(router: Router<AppState>) -> Router<AppState> {
|
||||
router
|
||||
// Status endpoints
|
||||
.route("/api/status", get(status::handle_status))
|
||||
|
||||
// Item endpoints
|
||||
.route("/api/item/", get(item::handle_list_items).post(item::handle_post_item))
|
||||
.route("/api/item/latest", get(item::handle_get_item_latest))
|
||||
.route("/api/item/latest/meta", get(item::handle_get_item_latest_meta))
|
||||
.route("/api/item/latest/content", get(item::handle_get_content_latest))
|
||||
.route("/api/item/:id", get(item::handle_get_item).delete(item::handle_delete_item))
|
||||
.route("/api/item/:id/meta", get(item::handle_get_item_meta))
|
||||
.route("/api/item/:id/content", get(item::handle_get_content))
|
||||
}
|
||||
Reference in New Issue
Block a user