refactor: fewer non-macro queries
Some checks failed
/ integration-test--firefox (push) Failing after 3m5s
Some checks failed
/ integration-test--firefox (push) Failing after 3m5s
This commit is contained in:
parent
69e23fd9bb
commit
84c41dda4d
5 changed files with 119 additions and 111 deletions
|
|
@ -55,15 +55,9 @@ mod get {
|
|||
let mut calendar = Calendar::new();
|
||||
calendar.name(&calname);
|
||||
calendar.append_property(("PRODID", "Mascarpone CRM"));
|
||||
let contacts: Vec<HydratedContact> = sqlx::query_as(
|
||||
"select id, birthday, (
|
||||
select string_agg(name,'\x1c' order by sort)
|
||||
from names where contact_id = c.id
|
||||
) as names
|
||||
from contacts c",
|
||||
)
|
||||
.fetch_all(&pool)
|
||||
.await?;
|
||||
|
||||
// TODO; this does some db work to pull in last_modified_date that we don't use
|
||||
let contacts = HydratedContact::all(&pool).await?;
|
||||
for contact in &contacts {
|
||||
if let Some(Birthday::Date(yo_date)) = &contact.birthday {
|
||||
if let Some(date) = NaiveDate::from_ymd_opt(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue