fix: don't generate broken sql
This commit is contained in:
parent
57177612ec
commit
c7130bbcd4
6 changed files with 23 additions and 14 deletions
|
|
@ -102,12 +102,14 @@ pub async fn journal_section(
|
|||
are now, or leave everything blank to default to 'today'. Entries will be
|
||||
added to the top of the list regardless of date; refresh the page to re-sort."
|
||||
}
|
||||
form hx-post="/journal_entry" hx-target="next .entries" hx-swap="afterbegin" hx-on::after-request="if(event.detail.successful) this.reset()" {
|
||||
form hx-post="/journal_entry" hx-target="next .entries" hx-target-error="#journal-error" hx-swap="afterbegin" hx-on::after-request="if(event.detail.successful) this.reset()" {
|
||||
input name="date" placeholder=(Local::now().date_naive().to_string());
|
||||
textarea name="value" placeholder="New entry..." autofocus {}
|
||||
input type="submit" value="Add Entry";
|
||||
}
|
||||
|
||||
#journal-error {}
|
||||
|
||||
.entries {
|
||||
@for entry in entries {
|
||||
(entry.to_html(pool).await?)
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ mod post {
|
|||
let switchboard = sw_lock.read().unwrap();
|
||||
switchboard.extract_mentions(&entry)
|
||||
};
|
||||
tracing::debug!("{:?}", mentions);
|
||||
insert_mentions(&mentions, pool).await?;
|
||||
|
||||
Ok(entry.to_html(pool).await?)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ struct ContactLink {
|
|||
name: String,
|
||||
contact_id: DbId,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Layout {
|
||||
contact_links: Vec<ContactLink>,
|
||||
user: User,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue