aboutsummaryrefslogtreecommitdiff
path: root/src/app/form.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/form.rs')
-rw-r--r--src/app/form.rs5
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(_) => {