remove download endpoint
This commit is contained in:
@@ -60,11 +60,6 @@ struct DocumentListItem {
|
||||
current_version: Option<DocumentVersionPayload>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct DocumentDownload {
|
||||
filename: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct BulkReanalyze {
|
||||
queued: usize,
|
||||
@@ -238,24 +233,6 @@ async fn upload_and_list_document() -> Result<()> {
|
||||
.download_path
|
||||
.starts_with("/download/"));
|
||||
|
||||
let download = app
|
||||
.get(
|
||||
&format!("/api/documents/{}/download", detail.document.id),
|
||||
Some(&token),
|
||||
)
|
||||
.await?;
|
||||
{
|
||||
let status = download.status();
|
||||
assert!(
|
||||
status == StatusCode::OK
|
||||
|| status == StatusCode::CREATED
|
||||
|| status == StatusCode::NO_CONTENT
|
||||
);
|
||||
}
|
||||
let body = body_to_vec(download.into_body()).await?;
|
||||
let download_info: DocumentDownload = serde_json::from_slice(&body)?;
|
||||
assert_eq!(download_info.filename, "doc.txt");
|
||||
|
||||
let redirect = app.get(¤t_version.download_path, None).await?;
|
||||
assert_eq!(redirect.status(), StatusCode::TEMPORARY_REDIRECT);
|
||||
let location = redirect
|
||||
|
||||
Reference in New Issue
Block a user