Set options on request types

This commit is contained in:
Tobias Reisinger 2023-12-05 02:41:43 +01:00
parent 2a82cf79c4
commit e2cd84b136
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 96 additions and 33 deletions
emgauwa-core/src/handlers/v1

View file

@ -2,7 +2,7 @@ use actix_web::{delete, get, put, web, HttpResponse};
use emgauwa_lib::db::DbController;
use emgauwa_lib::errors::{DatabaseError, EmgauwaError};
use emgauwa_lib::models::{convert_db_list, Controller, FromDbModel};
use emgauwa_lib::types::{ControllerUid, RequestController};
use emgauwa_lib::types::{ControllerUid, RequestUpdateController};
use sqlx::{Pool, Sqlite};
#[get("/api/v1/controllers")]
@ -38,7 +38,7 @@ pub async fn show(
pub async fn update(
pool: web::Data<Pool<Sqlite>>,
path: web::Path<(String,)>,
data: web::Json<RequestController>,
data: web::Json<RequestUpdateController>,
) -> Result<HttpResponse, EmgauwaError> {
let mut pool_conn = pool.acquire().await?;