13 lines
284 B
Rust
13 lines
284 B
Rust
use rocket::response::status::BadRequest;
|
|
use serde_json::json;
|
|
|
|
pub mod item;
|
|
|
|
type ApiError = BadRequest<serde_json::Value>;
|
|
type FallibleApiResponse = Result<serde_json::Value, ApiError>;
|
|
|
|
fn api_error(msg: &str) -> ApiError {
|
|
BadRequest(json!({
|
|
"error": msg
|
|
}))
|
|
}
|