implement page session restore

This commit is contained in:
yggverse 2024-10-11 22:08:11 +03:00
parent 6e9ea25ffd
commit 14b1620dc9
3 changed files with 154 additions and 13 deletions

View file

@ -103,10 +103,8 @@ impl Item {
match Database::delete(transaction, &record.id) {
Ok(_) => {
// Delegate clean action to the item childs
self.page.clean(transaction, &record.id)?;
self.widget.clean(transaction, &record.id)?;
/* @TODO
self.page.clean(transaction, &record.id)?;*/
}
Err(e) => return Err(e.to_string()),
}
@ -151,11 +149,9 @@ impl Item {
);
// Delegate restore action to the item childs
item.page.restore(transaction, &record.id)?;
item.widget.restore(transaction, &record.id)?;
/* @TODO
self.page.restore(transaction, &id)?; */
// Result
items.push(item);
}
@ -185,10 +181,8 @@ impl Item {
let id = Database::last_insert_id(transaction);
// Delegate save action to childs
self.page.save(transaction, &id)?;
self.widget.save(transaction, &id)?;
/* @TODO
self.page.save(transaction, &id)?; */
}
Err(e) => return Err(e.to_string()),
}
@ -221,11 +215,9 @@ impl Item {
}
// Delegate migration to childs
Page::migrate(&tx)?;
Widget::migrate(&tx)?;
/* @TODO
Page::migrate(&tx)? */
// Success
Ok(())
}