delegate result handle to the transaction initiator

This commit is contained in:
yggverse 2024-10-07 21:10:12 +03:00
parent a1f2d57b6d
commit 47e2bc4617
6 changed files with 186 additions and 83 deletions

View file

@ -120,7 +120,11 @@ impl App {
match Database::records(&transaction) {
Ok(records) => {
for record in records {
browser.restore(&transaction, &record.id);
if let Err(e) =
browser.restore(&transaction, &record.id)
{
todo!("{e}")
}
}
}
Err(e) => todo!("{e}"),
@ -158,7 +162,11 @@ impl App {
match Database::delete(&transaction, &record.id) {
Ok(_) => {
// Delegate clean action to childs
browser.clean(&transaction, &record.id);
if let Err(e) =
browser.clean(&transaction, &record.id)
{
todo!("{e}")
}
}
Err(e) => todo!("{e}"),
}
@ -168,10 +176,12 @@ impl App {
match Database::add(&transaction) {
Ok(_) => {
// Delegate save action to childs
browser.save(
if let Err(e) = browser.save(
&transaction,
&Database::last_insert_id(&transaction),
);
) {
todo!("{e}")
}
}
Err(e) => todo!("{e}"),
}