Skip to content

Commit

Permalink
Rename types.
Browse files Browse the repository at this point in the history
  • Loading branch information
emmiegit committed Sep 10, 2024
1 parent a10ca49 commit 01caee9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deepwell/src/services/file/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions deepwell/src/services/file/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions deepwell/src/services/file_revision/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FinishUploadOutput> {
}: FinishFileRevisionUpload,
) -> Result<FinishFileRevisionUploadOutput> {
let txn = ctx.transaction();

// Move upload to final location, get its metadata
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions deepwell/src/services/file_revision/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ 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,
pub pending_blob_id: i64,
}

#[derive(Serialize, Debug, Copy, Clone)]
pub struct FinishUploadOutput {
pub struct FinishFileRevisionUploadOutput {
pub file_id: i64,
pub file_revision_id: i64,
pub s3_hash: Bytes,
Expand Down

0 comments on commit 01caee9

Please sign in to comment.