Allow multiple posts of address report

Since this is the first step of scanning the mailer.
This commit is contained in:
Eli Ribble 2026-04-29 19:30:43 +00:00
parent af39a73e8f
commit da75aeecf2
No known key found for this signature in database

View file

@ -110,6 +110,15 @@ func (res *complianceR) Create(ctx context.Context, r *http.Request, n publicrep
public_id := n.MailerID.MustGet()
setter_report.PublicID = omit.From(public_id)
// If it already exists, just return it
report, err := platform.PublicReportByIDCompliance(ctx, public_id, true)
if err != nil {
return nil, nhttp.NewError("check existing report: %w", err)
}
if report != nil {
return res.complianceHydrate(report, true)
}
org_id, err = platform.OrganizationIDForComplianceReportRequest(ctx, public_id)
if err != nil {
return nil, nhttp.NewBadRequest("no such mailer")