feat: add thumbnail spec
This commit is contained in:
@@ -42,7 +42,6 @@ pub async fn get_repos(
|
||||
.into_iter()
|
||||
.map(|r| r.id)
|
||||
.collect::<HashSet<String>>();
|
||||
println!("{added_ids:?}");
|
||||
let data = response
|
||||
.json::<Vec<Repository>>()
|
||||
.await?
|
||||
|
||||
@@ -33,7 +33,9 @@ pub async fn proxy_file(
|
||||
.bearer_auth(token)
|
||||
.send()
|
||||
.await?;
|
||||
response.error_for_status_ref()?;
|
||||
response
|
||||
.error_for_status_ref()
|
||||
.map_err(|_| crate::error::Error::NotFound)?;
|
||||
|
||||
let bytes = response.bytes().await?;
|
||||
let mime = mime_guess::from_path(&path.file)
|
||||
|
||||
@@ -54,7 +54,9 @@ impl ResponseError for Error {
|
||||
Error::ValidationFailed(msg) => {
|
||||
HttpResponse::BadRequest().json(ErrorResponse { error: msg.clone() })
|
||||
}
|
||||
Error::NotFound => HttpResponse::NotFound().finish(),
|
||||
Error::NotFound => HttpResponse::NotFound().json(ErrorResponse {
|
||||
error: "not found".to_string(),
|
||||
}),
|
||||
_ => HttpResponse::InternalServerError().finish(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user