catch model up to multi-author lines

now the only thing missing is the quote adding UI support - multiauthor
lines can already be added via API
This commit is contained in:
2026-04-23 22:48:51 +02:00
parent 48e14a5830
commit 983e1ae88f
4 changed files with 49 additions and 30 deletions

View File

@@ -33,7 +33,7 @@ pub async fn get_by_id(
#[derive(Deserialize)]
pub struct QuoteLineForm {
pub content: String,
pub name_id: Uuid,
pub name_ids: Vec<Uuid>,
}
#[derive(Deserialize)]
@@ -55,8 +55,11 @@ pub async fn create(
let mut lines = Vec::with_capacity(form.lines.len());
for l in form.lines {
let name = Name::get_by_id(&mut tx, l.name_id).await?;
lines.push((l.content, name));
let mut names = Vec::with_capacity(l.name_ids.len());
for id in l.name_ids {
names.push(Name::get_by_id(&mut tx, id).await?);
}
lines.push((l.content, names));
}
let q = Quote::create(