synthwave/src/route/mod.rs
2024-07-26 14:14:08 +02:00

16 lines
334 B
Rust

use rocket::response::status::BadRequest;
use serde_json::json;
pub mod album;
pub mod artist;
pub mod track;
pub mod user;
type ApiError = BadRequest<serde_json::Value>;
type FallibleApiResponse = Result<serde_json::Value, ApiError>;
pub fn api_error(msg: &str) -> ApiError {
BadRequest(json!({
"error": msg
}))
}