max / makenotwork
| 1 | use ; |
| 2 | |
| 3 | /// Insert a footnote on a post. Returns the footnote ID. |
| 4 | |
| 5 | pub async |
| 6 | pool: &PgPool, |
| 7 | post_id: Uuid, |
| 8 | author_id: Uuid, |
| 9 | body_markdown: &str, |
| 10 | body_html: &str, |
| 11 | |
| 12 | query_scalar! |
| 13 | "INSERT INTO post_footnotes (post_id, author_id, body_markdown, body_html) |
| 14 | VALUES ($1, $2, $3, $4) |
| 15 | RETURNING id", |
| 16 | post_id, |
| 17 | author_id, |
| 18 | body_markdown, |
| 19 | body_html, |
| 20 | |
| 21 | .fetch_one |
| 22 | .await |
| 23 | |
| 24 |