synthwave/src/route/mod.rs

17 lines
334 B
Rust
Raw Normal View History

2024-07-24 09:07:24 +00:00
use rocket::response::status::BadRequest;
use serde_json::json;
pub mod album;
2024-07-26 12:14:08 +00:00
pub mod artist;
2024-07-24 09:07:24 +00:00
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
}))
}