From 9d78c98bcbca049441f40929e97052b44c5e019a Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 28 Jan 2026 11:29:41 +0100 Subject: [PATCH] location handler --- src/handlers/locations.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/handlers/locations.rs diff --git a/src/handlers/locations.rs b/src/handlers/locations.rs new file mode 100644 index 0000000..5dab84a --- /dev/null +++ b/src/handlers/locations.rs @@ -0,0 +1,19 @@ +use actix_web::web::Json; +use serde_json::json; + +async fn get_locations() -> impl Responder { + let locations = vec![]; + Json(locations) +} + +async fn create_location(Json(location): Json) -> impl Responder { + Json(location) +} + +async fn update_location(Json(location): Json) -> impl Responder { + Json(location) +} + +async fn delete_location(timestamp: i64) -> impl Responder { + format!("Deleted location with timestamp: {}", timestamp) +} \ No newline at end of file