From 5166efe517291f5c9fc6326f30651ef799d6db65 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 9 Jan 2022 13:39:10 +0100 Subject: Add id in event model --- src/app/form.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/app/form.rs') 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, tx: Sender, window: Rc, @@ -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(_) => { -- cgit v1.2.3