chore: add get_animation_by_name
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
858d0aca66
commit
94d716ef9c
@ -362,6 +362,17 @@ pub async fn start_animation(
|
|||||||
create_message(200, "Started animation")
|
create_message(200, "Started animation")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[get("/animation/<name>")]
|
||||||
|
pub async fn get_animation_by_name(name: &str, db: &State<DBPool>) -> String {
|
||||||
|
let animation = get_animation_or_string_error(name, db);
|
||||||
|
if let Err(animation) = animation {
|
||||||
|
return animation;
|
||||||
|
}
|
||||||
|
let animation = animation.unwrap();
|
||||||
|
|
||||||
|
json!(animation).to_string()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Clear animations
|
* Clear animations
|
||||||
|
@ -233,6 +233,7 @@ async fn main() -> GResult {
|
|||||||
animations::get_animation_request,
|
animations::get_animation_request,
|
||||||
animations::toggle_animation,
|
animations::toggle_animation,
|
||||||
animations::get_animations,
|
animations::get_animations,
|
||||||
|
animations::get_animation_by_name,
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
.manage(conn_pool_arc.clone())
|
.manage(conn_pool_arc.clone())
|
||||||
|
Loading…
Reference in New Issue
Block a user