Skip to content

Commit 650123c

Browse files
committed
Fix which kind of ID is returned in tech review endpoints
1 parent 6ef5044 commit 650123c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

apps/labrinth/src/routes/internal/moderation/tech_review.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ use crate::{
1212
database::{
1313
DBProject,
1414
models::{
15-
DBFileId, DBProjectId, DBThread, DBThreadId, DBVersionId,
16-
DelphiReportId, DelphiReportIssueId, ProjectTypeId,
15+
DBProjectId, DBThread, DBThreadId, DelphiReportId,
16+
DelphiReportIssueId, ProjectTypeId,
1717
delphi_report_item::{
1818
DelphiReportIssueStatus, DelphiSeverity, ReportIssueDetail,
1919
},
2020
},
2121
redis::RedisPool,
2222
},
2323
models::{
24-
ids::{ProjectId, ThreadId},
24+
ids::{FileId, ProjectId, ThreadId, VersionId},
2525
pats::Scopes,
2626
projects::Project,
2727
},
@@ -97,11 +97,11 @@ pub struct FileReport {
9797
/// ID of this report.
9898
pub id: DelphiReportId,
9999
/// ID of the file that was scanned.
100-
pub file_id: DBFileId,
100+
pub file_id: FileId,
101101
/// ID of the project version this report is for.
102-
pub version_id: DBVersionId,
102+
pub version_id: VersionId,
103103
/// ID of the project this report is for.
104-
pub project_id: DBProjectId,
104+
pub project_id: ProjectId,
105105
/// When the report for this file was created.
106106
pub created: DateTime<Utc>,
107107
/// Why this project was flagged.
@@ -233,9 +233,9 @@ async fn get_report(
233233
SELECT
234234
to_jsonb(dr)
235235
|| jsonb_build_object(
236-
'file_id', f.id,
237-
'version_id', v.id,
238-
'project_id', v.mod_id,
236+
'file_id', to_base62(f.id),
237+
'version_id', to_base62(v.id),
238+
'project_id', to_base62(v.mod_id),
239239
'file_name', f.filename,
240240
'file_size', f.size,
241241
'flag_reason', 'delphi',
@@ -324,9 +324,9 @@ async fn search_projects(
324324
t.id AS "project_thread_id: DBThreadId",
325325
to_jsonb(dr)
326326
|| jsonb_build_object(
327-
'file_id', f.id,
328-
'version_id', v.id,
329-
'project_id', v.mod_id,
327+
'file_id', to_base62(f.id),
328+
'version_id', to_base62(v.id),
329+
'project_id', to_base62(v.mod_id),
330330
'file_name', f.filename,
331331
'file_size', f.size,
332332
'flag_reason', 'delphi',

0 commit comments

Comments
 (0)