Improve api schema
This commit is contained in:
parent
f23bb48fa1
commit
f9ad8f9399
9 changed files with 123 additions and 164 deletions
src/handlers/v1
|
@ -12,6 +12,7 @@ use emgauwa_common::types::{
|
|||
|
||||
use crate::app_state;
|
||||
use crate::app_state::AppState;
|
||||
use crate::handlers::EmgauwaMessage;
|
||||
|
||||
#[get("/macros")]
|
||||
pub async fn index(pool: web::Data<Pool<Sqlite>>) -> Result<HttpResponse, EmgauwaError> {
|
||||
|
@ -98,7 +99,7 @@ pub async fn delete(
|
|||
let uid = EmgauwaUid::try_from(macro_uid.as_str())?;
|
||||
|
||||
DbMacro::delete_by_uid(&mut pool_conn, uid).await?;
|
||||
Ok(HttpResponse::Ok().json("macro got deleted"))
|
||||
Ok(HttpResponse::Ok().emgauwa_message("macro got deleted"))
|
||||
}
|
||||
|
||||
#[put("/macros/{macro_id}/execute")]
|
||||
|
@ -160,5 +161,5 @@ pub async fn execute(
|
|||
.await??;
|
||||
}
|
||||
|
||||
Ok(HttpResponse::Ok().finish()) // TODO add a message?
|
||||
Ok(HttpResponse::Ok().emgauwa_message("macro got executed"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue