Upgrade to Actix V2, bump SQLX version, code cleanup, intergrate ratelimiter (#288)

* Upgrade to Actix V2, bump SQLX version, code cleanup, intergrate ratelimiter

* Add pack file path validation

* Fix compilation error caused by incorrect merge
This commit is contained in:
Geometrically
2022-02-05 23:08:30 -07:00
committed by GitHub
parent 6a89646e66
commit 6bf5dbabee
27 changed files with 1417 additions and 1649 deletions

View File

@@ -100,20 +100,21 @@ impl Report {
FROM reports r
INNER JOIN report_types rt ON rt.id = r.report_type_id
WHERE r.id = ANY($1)
ORDER BY r.created DESC
",
&report_ids_parsed
)
.fetch_many(exec)
.try_filter_map(|e| async {
Ok(e.right().map(|row| QueryReport {
id: ReportId(row.id),
report_type: row.name,
project_id: row.mod_id.map(ProjectId),
version_id: row.version_id.map(VersionId),
user_id: row.user_id.map(UserId),
body: row.body,
reporter: UserId(row.reporter),
created: row.created,
Ok(e.right().map(|x| QueryReport {
id: ReportId(x.id),
report_type: x.name,
project_id: x.mod_id.map(ProjectId),
version_id: x.version_id.map(VersionId),
user_id: x.user_id.map(UserId),
body: x.body,
reporter: UserId(x.reporter),
created: x.created,
}))
})
.try_collect::<Vec<QueryReport>>()