Make publicreport by ID base redirect to detailed information

This commit is contained in:
Eli Ribble 2026-04-14 16:07:17 +00:00
parent 4a28a16639
commit fe41df3e16
No known key found for this signature in database
4 changed files with 44 additions and 14 deletions

View file

@ -219,6 +219,15 @@ func PublicReportWaterCreate(ctx context.Context, setter_report models.Publicrep
return nil
})
}
func PublicReportTypeByID(ctx context.Context, public_id string) (string, error) {
report, err := models.PublicreportReports.Query(
models.SelectWhere.PublicreportReports.PublicID.EQ(public_id),
).One(ctx, db.PGInstance.BobDB)
if err != nil {
return "", fmt.Errorf("query report '%s': %w", public_id, err)
}
return report.ReportType.String(), nil
}
type funcSetReportDetail = func(context.Context, bob.Executor, int32) error