feat: sort answer by date, olders firsts
This commit is contained in:
parent
6913defcd9
commit
aa4ea8cc4e
3 changed files with 8 additions and 0 deletions
4
TODO.md
4
TODO.md
|
@ -58,3 +58,7 @@ curl -u $PAHEKO_CLIENT_ID:$PAHEKO_CLIENT_SECRET http://localhost:8082/api/sql -d
|
|||
|
||||
- handle additional donation amount
|
||||
|
||||
## 2024-01-21
|
||||
|
||||
- to sort members by date, process older answers first
|
||||
|
||||
|
|
|
@ -355,6 +355,8 @@ impl Organization {
|
|||
for entry in data {
|
||||
answers.push(serde_json::from_value(entry).context("Cannot parse FormAnswer")?)
|
||||
}
|
||||
// sort by date, most older first
|
||||
answers.sort_by(|a, b| a.order.inception_time.cmp(&b.order.inception_time));
|
||||
Ok(answers)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -139,6 +139,8 @@ pub async fn sync_csv(
|
|||
|
||||
generalized_answers.push(generalized_answer);
|
||||
}
|
||||
// sort by date, most older first
|
||||
generalized_answers.sort_by(|a, b| a.inception_time.cmp(&b.inception_time));
|
||||
eprintln!("Generated GeneralizedAnswers");
|
||||
sync_paheko(
|
||||
paheko_client,
|
||||
|
|
Loading…
Reference in a new issue