Skip to content

Commit 1c01d72

Browse files
committed
backend/send_chargelog: add filename to schema
1 parent 6d7064b commit 1c01d72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

backend/src/routes/send_chargelog_to_user.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ pub struct SendChargelogSchema {
1616
pub charger_uuid: String,
1717
pub password: String,
1818
pub user_uuid: String,
19-
pub chargelog: Vec<u8>, // binary data
19+
pub filename: String,
20+
pub chargelog: Vec<u8>,
2021
}
2122

2223
#[utoipa::path(
@@ -64,7 +65,7 @@ pub async fn send_chargelog(
6465
subject,
6566
body,
6667
payload.chargelog.clone(),
67-
"chargelog.pdf",
68+
&payload.filename,
6869
&state,
6970
);
7071

@@ -90,6 +91,7 @@ mod tests {
9091
charger_uuid: charger.uuid.clone(),
9192
password: charger.password.clone(),
9293
user_uuid: crate::routes::user::tests::get_test_uuid(&user.mail).unwrap().to_string(),
94+
filename: "chargelog.pdf".to_string(),
9395
chargelog: vec![1, 2, 3, 4, 5],
9496
};
9597

@@ -115,6 +117,7 @@ mod tests {
115117
charger_uuid: charger.uuid.clone(),
116118
password: "wrongpassword".to_string(),
117119
user_uuid: crate::routes::user::tests::get_test_uuid(&user.mail).unwrap().to_string(),
120+
filename: "chargelog.pdf".to_string(),
118121
chargelog: vec![1, 2, 3, 4, 5],
119122
};
120123

0 commit comments

Comments
 (0)