Add an evidence field to compliance reports
This allows us to show a page with information about what the district is concerned about when asking the user to fill a report.
This commit is contained in:
parent
a0ac5c0674
commit
fe2041f22b
7 changed files with 99 additions and 32 deletions
|
|
@ -57,7 +57,23 @@ func PublicreportByID(ctx context.Context, report_id string) (*types.PublicRepor
|
|||
return publicreport.ByID(ctx, report_id)
|
||||
}
|
||||
func PublicreportByIDCompliance(ctx context.Context, report_id string) (*types.PublicReportCompliance, error) {
|
||||
return publicreport.ByIDCompliance(ctx, report_id)
|
||||
result, err := publicreport.ByIDCompliance(ctx, report_id)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("byidcompliance: %w", err)
|
||||
}
|
||||
// Check for evidence if this is a mailer-based compliance request
|
||||
crr, err := ComplianceReportRequestFromPublicID(ctx, result.PublicID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("compliance report request by public id: %w", err)
|
||||
}
|
||||
if crr != nil {
|
||||
result.Evidence = []*types.EvidenceComplianceReportRequest{
|
||||
&types.EvidenceComplianceReportRequest{
|
||||
ComplianceReportRequestPublicID: crr.PublicID,
|
||||
},
|
||||
}
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
func PublicreportByIDNuisance(ctx context.Context, report_id string) (*types.PublicReportNuisance, error) {
|
||||
return publicreport.ByIDNuisance(ctx, report_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue