@@ -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