mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
draft db actions
This commit is contained in:
parent
ad3f6083e1
commit
17dedbd36e
3 changed files with 52 additions and 31 deletions
24
src/app.rs
24
src/app.rs
|
|
@ -113,4 +113,28 @@ impl App {
|
|||
pub fn run(&self) -> ExitCode {
|
||||
self.app.run()
|
||||
}
|
||||
|
||||
pub fn save(&self) {
|
||||
// Cleanup previous record
|
||||
match self.database.clean() {
|
||||
Ok(_) => {
|
||||
// Delegate clean action to children components
|
||||
// self.browser.clean(app_id) @TODO
|
||||
// ..
|
||||
|
||||
// Create new record
|
||||
match self.database.add() {
|
||||
Ok(_) => {
|
||||
// let app_id = self.database.last_insert_id();
|
||||
|
||||
// Delegate save action to children components
|
||||
// self.browser.save(app_id) @TODO
|
||||
// ..
|
||||
}
|
||||
Err(error) => panic!("{error}"), // @TODO
|
||||
}
|
||||
}
|
||||
Err(error) => panic!("{error}"), // @TODO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue