refactor: rename item handler functions to match route paths consistently
Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
@@ -167,7 +167,7 @@ pub async fn handle_delete_item(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_get_content_latest(
|
pub async fn handle_get_item_latest(
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
Query(params): Query<TagsQuery>,
|
Query(params): Query<TagsQuery>,
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
@@ -219,7 +219,7 @@ pub async fn handle_get_content_latest(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_get_content(
|
pub async fn handle_get_item(
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
Path(item_id): Path<String>,
|
Path(item_id): Path<String>,
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
@@ -270,7 +270,7 @@ pub async fn handle_get_content(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_get_content_latest_raw(
|
pub async fn handle_get_item_latest_content(
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
Query(params): Query<TagsQuery>,
|
Query(params): Query<TagsQuery>,
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
@@ -317,7 +317,7 @@ pub async fn handle_get_content_latest_raw(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn handle_get_content_raw(
|
pub async fn handle_get_item_content(
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
Path(item_id): Path<String>,
|
Path(item_id): Path<String>,
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
|
|||||||
@@ -15,10 +15,10 @@ pub fn add_routes(router: Router<AppState>) -> Router<AppState> {
|
|||||||
|
|
||||||
// Item endpoints
|
// Item endpoints
|
||||||
.route("/api/item/", get(item::handle_list_items).post(item::handle_post_item))
|
.route("/api/item/", get(item::handle_list_items).post(item::handle_post_item))
|
||||||
.route("/api/item/latest", get(item::handle_get_content_latest))
|
.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/meta", get(item::handle_get_item_latest_meta))
|
||||||
.route("/api/item/latest/content", get(item::handle_get_content_latest_raw))
|
.route("/api/item/latest/content", get(item::handle_get_item_latest_content))
|
||||||
.route("/api/item/:id", get(item::handle_get_content).delete(item::handle_delete_item))
|
.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/meta", get(item::handle_get_item_meta))
|
||||||
.route("/api/item/:id/content", get(item::handle_get_content_raw))
|
.route("/api/item/:id/content", get(item::handle_get_item_content))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user