This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user