diff options
author | Joris | 2022-01-09 13:39:10 +0100 |
---|---|---|
committer | Joris | 2022-01-09 13:39:10 +0100 |
commit | 5166efe517291f5c9fc6326f30651ef799d6db65 (patch) | |
tree | 36df3d65c9e7218bff2264391032ecd28001a688 /src/app/form.rs | |
parent | 99af88a840bef534540a4b273d24a8a17e7fc9b9 (diff) |
Add id in event model
Diffstat (limited to 'src/app/form.rs')
-rw-r--r-- | src/app/form.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/app/form.rs b/src/app/form.rs index fc3dc83..08a2af1 100644 --- a/src/app/form.rs +++ b/src/app/form.rs @@ -6,10 +6,11 @@ use gtk::glib; use gtk::prelude::*; use rusqlite::Connection; use std::rc::Rc; +use uuid::Uuid; use crate::{app::update, app::update::Msg, db, model::event}; -pub async fn dialog( +pub async fn show( conn: Rc<Connection>, tx: Sender<Msg>, window: Rc<gtk::ApplicationWindow>, @@ -49,7 +50,7 @@ pub async fn dialog( let button = gtk::Button::with_label("Créer"); vbox.append(&button); button.connect_clicked(glib::clone!(@weak dialog => move |_| { - match event::validate(date.buffer().text(), name.buffer().text(), start.buffer().text(), end.buffer().text()) { + match event::validate(Uuid::new_v4(), date.buffer().text(), name.buffer().text(), start.buffer().text(), end.buffer().text()) { Some(event) => { match db::insert(&conn, &event) { Ok(_) => { |