diff --git a/deepwell/src/services/file/service.rs b/deepwell/src/services/file/service.rs index 9799d6d89f2..c36a5d18cf8 100644 --- a/deepwell/src/services/file/service.rs +++ b/deepwell/src/services/file/service.rs @@ -147,7 +147,7 @@ impl FileService { // This gets the data from BlobService and then deletes the row. FileRevisionService::finish_upload( ctx, - FinishUpload { + FinishUploadFile { site_id, page_id, file_id, diff --git a/deepwell/src/services/file/structs.rs b/deepwell/src/services/file/structs.rs index 25564859e5b..a808ccb3a94 100644 --- a/deepwell/src/services/file/structs.rs +++ b/deepwell/src/services/file/structs.rs @@ -20,7 +20,7 @@ use crate::models::sea_orm_active_enums::FileRevisionType; use crate::services::file_revision::{ - CreateFileRevisionOutput, CreateFirstFileRevisionOutput, FinishUploadOutput, + CreateFileRevisionOutput, CreateFirstFileRevisionOutput, FinishFileRevisionUploadOutput, }; use crate::web::{Bytes, FileDetails, ProvidedValue, Reference}; use serde_json::Value as JsonValue; @@ -54,7 +54,7 @@ pub struct FinishUploadFile { pub pending_blob_id: i64, } -pub type FinishUploadFileOutput = FinishUploadOutput; +pub type FinishUploadFileOutput = FinishFileRevisionUploadOutput; #[derive(Deserialize, Debug, Clone)] pub struct UploadFileEdit { diff --git a/deepwell/src/services/file_revision/service.rs b/deepwell/src/services/file_revision/service.rs index 184b3ff7289..7f2fc8211f8 100644 --- a/deepwell/src/services/file_revision/service.rs +++ b/deepwell/src/services/file_revision/service.rs @@ -447,13 +447,13 @@ impl FileRevisionService { /// For a pending file, fill in the uploaded data fields. pub async fn finish_upload( ctx: &ServiceContext<'_>, - FinishUpload { + FinishFileRevisionUpload { site_id, page_id, file_id, pending_blob_id, - }: FinishUpload, - ) -> Result { + }: FinishFileRevisionUpload, + ) -> Result { let txn = ctx.transaction(); // Move upload to final location, get its metadata @@ -475,7 +475,7 @@ impl FileRevisionService { model.size_hint = Set(size); let file_revision = model.update(txn).await?; - Ok(FinishUploadOutput { + Ok(FinishFileRevisionUploadOutput { file_id, file_revision_id: file_revision.revision_id, s3_hash: Bytes::from(file_revision.s3_hash), diff --git a/deepwell/src/services/file_revision/structs.rs b/deepwell/src/services/file_revision/structs.rs index 1be072ec515..4cfd3662db7 100644 --- a/deepwell/src/services/file_revision/structs.rs +++ b/deepwell/src/services/file_revision/structs.rs @@ -124,7 +124,7 @@ pub struct UpdateFileRevision { } #[derive(Deserialize, Debug, Clone)] -pub struct FinishUpload { +pub struct FinishFileRevisionUpload { pub site_id: i64, pub page_id: i64, pub file_id: i64, @@ -132,7 +132,7 @@ pub struct FinishUpload { } #[derive(Serialize, Debug, Copy, Clone)] -pub struct FinishUploadOutput { +pub struct FinishFileRevisionUploadOutput { pub file_id: i64, pub file_revision_id: i64, pub s3_hash: Bytes,