Skip to content

Commit

Permalink
Rename to expiresAt
Browse files Browse the repository at this point in the history
  • Loading branch information
Loudbooks committed Dec 11, 2024
1 parent 990b453 commit 0029c9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/src/controllers/upload_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub async fn upload_handler(
report_book,
wrap,
creator_ip: ip.clone(),
expires,
expires_at: expires,
};

if let Err(e) = aws_service.put_file(&file_id, (&body).as_ref()).await {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/delete_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl DeleteHandler {
while let Some(paste) = pastes_cursor.next().await {
let paste = paste.expect("Failed to get paste");

if paste.expires > 0 && paste.expires < now as u64 {
if paste.expires_at > 0 && paste.expires_at < now as u64 {
deletable_pastes.push(paste.clone());
}

Expand Down
8 changes: 5 additions & 3 deletions backend/src/models/paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ pub struct Paste {
pub report_book: bool,
pub wrap: bool,
pub creator_ip: String,
pub expires: u64,
#[serde(rename = "expiresAt")]
pub expires_at: u64,
}

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand All @@ -20,7 +21,8 @@ pub struct PasteDTO {
pub created: u64,
pub report_book: bool,
pub wrap: bool,
pub expires: u64,
#[serde(rename = "expiresAt")]
pub expires_at: u64,
}

impl Paste {
Expand All @@ -32,7 +34,7 @@ impl Paste {
created: self.created,
report_book: self.report_book,
wrap: self.wrap,
expires: self.expires,
expires_at: self.expires_at,
}
}
}

0 comments on commit 0029c9e

Please sign in to comment.