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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user