location handler
This commit is contained in:
19
src/handlers/locations.rs
Normal file
19
src/handlers/locations.rs
Normal file
@@ -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<Location>) -> impl Responder {
|
||||
Json(location)
|
||||
}
|
||||
|
||||
async fn update_location(Json(location): Json<Location>) -> impl Responder {
|
||||
Json(location)
|
||||
}
|
||||
|
||||
async fn delete_location(timestamp: i64) -> impl Responder {
|
||||
format!("Deleted location with timestamp: {}", timestamp)
|
||||
}
|
||||
Reference in New Issue
Block a user