Make publicreport by ID base redirect to detailed information
This commit is contained in:
parent
4a28a16639
commit
fe41df3e16
4 changed files with 44 additions and 14 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue