use super::logic;
use crate::error::{run_blocking, AppError};
use axum::{
extract::{Path, State},
Json,
};
use logic::{RoutineResponse, RoutineStore};
#[utoipa::path(delete, path = "/routines/{id}",
params(("id" = String, Path, description = "Routine UUID")),
responses((status = 200, body = RoutineResponse), (status = 404, description = "Not found")))]
pub async fn delete_routine(
State(store): State<RoutineStore>,
Path(id): Path<String>,
) -> Result<Json<RoutineResponse>, AppError> {
let resp = run_blocking(move || logic::build(&store, &id)).await?;
Ok(Json(resp))
}
#[cfg(test)]
#[path = "http_tests.rs"]
mod http_tests;