mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew
synced 2026-08-26 15:02:18 +08:00
Split giant router api function mess
This commit is contained in:
@@ -1,8 +1,14 @@
|
||||
use jzon::{object, JsonValue};
|
||||
use actix_web::{HttpRequest};
|
||||
use jzon::object;
|
||||
use actix_web::{web, HttpRequest, Responder};
|
||||
|
||||
pub fn location(_req: HttpRequest) -> Option<JsonValue> {
|
||||
Some(object!{
|
||||
"master_location_ids": []
|
||||
})
|
||||
use crate::router::global;
|
||||
|
||||
pub fn routes(cfg: &mut web::ServiceConfig) {
|
||||
cfg.route("/location", web::get().to(location));
|
||||
}
|
||||
|
||||
async fn location(req: HttpRequest) -> impl Responder {
|
||||
global::api(&req, Some(object!{
|
||||
"master_location_ids": []
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user