Improve backend code quality
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2025-11-03 19:08:46 +01:00
parent 75ffa69afd
commit 4cd448208b
6 changed files with 34 additions and 57 deletions

View File

@@ -23,10 +23,10 @@ impl UpdateInboxEntryQuery {
let constraints = ServerConstraints::default();
// Check inbox entry label
if let Some(label) = &self.label {
if !constraints.inbox_entry_label.check_str(label) {
return Ok(Some("Invalid inbox entry label length!"));
}
if let Some(label) = &self.label
&& !constraints.inbox_entry_label.check_str(label)
{
return Ok(Some("Invalid inbox entry label length!"));
}
// Check the referenced movement

View File

@@ -55,12 +55,11 @@ impl UpdateMovementQuery {
if let Ok(movement) =
get_by_account_label_amount_time(self.account_id, &self.label, self.amount, self.time)
.await
&& Some(movement.id()) != ref_movement
{
if Some(movement.id()) != ref_movement {
return Ok(Some(
"A movement taken at the same time with the same label and the same amount already exists!",
));
}
return Ok(Some(
"A movement taken at the same time with the same label and the same amount already exists!",
));
}
Ok(None)