working with UI library now
This commit is contained in:
@@ -301,6 +301,7 @@ pub async fn booking_new(
|
||||
"hour": q.hour.unwrap_or(FIRST_HOUR),
|
||||
"color": "#3b82f6",
|
||||
"name": "",
|
||||
"title": "",
|
||||
"contact": "",
|
||||
"note": "",
|
||||
"hours": hour_options(),
|
||||
@@ -316,6 +317,7 @@ pub struct BookingForm {
|
||||
pub hour: i32,
|
||||
pub color: String,
|
||||
pub name: String,
|
||||
pub title: Option<String>,
|
||||
pub contact: Option<String>,
|
||||
pub note: Option<String>,
|
||||
}
|
||||
@@ -338,6 +340,7 @@ pub async fn booking_create(
|
||||
hour: Set(form.hour),
|
||||
color: Set(form.color),
|
||||
name: Set(form.name),
|
||||
title: Set(form.title.filter(|s| !s.is_empty())),
|
||||
contact: Set(form.contact.filter(|s| !s.is_empty())),
|
||||
note: Set(form.note.filter(|s| !s.is_empty())),
|
||||
..Default::default()
|
||||
@@ -381,6 +384,7 @@ pub async fn booking_edit(
|
||||
"hour": booking.hour,
|
||||
"color": booking.color,
|
||||
"name": booking.name,
|
||||
"title": booking.title.unwrap_or_default(),
|
||||
"contact": booking.contact.unwrap_or_default(),
|
||||
"note": booking.note.unwrap_or_default(),
|
||||
"hours": hour_options(),
|
||||
@@ -407,6 +411,7 @@ pub async fn booking_update(
|
||||
active.hour = Set(form.hour);
|
||||
active.color = Set(form.color);
|
||||
active.name = Set(form.name);
|
||||
active.title = Set(form.title.filter(|s| !s.is_empty()));
|
||||
active.contact = Set(form.contact.filter(|s| !s.is_empty()));
|
||||
active.note = Set(form.note.filter(|s| !s.is_empty()));
|
||||
active.update(&ctx.db).await?;
|
||||
|
||||
Reference in New Issue
Block a user