From 07740f3d985b4cc921b69cd45ec9191a2daecd67 Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Wed, 10 Apr 2024 13:29:01 +0200 Subject: Closes #31. Renamed Payloads --- src/routes/device.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/routes/device.rs') diff --git a/src/routes/device.rs b/src/routes/device.rs index b6bd9d0..49361f2 100644 --- a/src/routes/device.rs +++ b/src/routes/device.rs @@ -32,7 +32,7 @@ pub async fn get(Path(id): Path) -> Result, Error> { } #[derive(Deserialize, ToSchema)] -pub struct Payload { +pub struct DPayload { id: String, mac: String, broadcast_addr: String, @@ -42,14 +42,14 @@ pub struct Payload { #[utoipa::path( put, path = "/device", - request_body = Payload, + request_body = DPayload, responses( (status = 200, description = "add device to storage", body = [DeviceSchema]) ), security((), ("api_key" = [])) )] pub async fn put( - Json(payload): Json, + Json(payload): Json, ) -> Result, Error> { info!( "add device {} ({}, {}, {})", @@ -73,14 +73,14 @@ pub async fn put( #[utoipa::path( post, path = "/device", - request_body = Payload, + request_body = DPayload, responses( (status = 200, description = "update device in storage", body = [DeviceSchema]) ), security((), ("api_key" = [])) )] pub async fn post( - Json(payload): Json, + Json(payload): Json, ) -> Result, Error> { info!( "edit device {} ({}, {}, {})", -- cgit v1.2.3