parent
34f4980ad5
commit
f4756637d6
5 changed files with 67 additions and 48 deletions
|
|
@ -2,6 +2,7 @@ package resource
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net/http"
|
||||
"slices"
|
||||
"time"
|
||||
|
|
@ -125,6 +126,9 @@ func (res *nuisanceR) Create(ctx context.Context, r *http.Request, n nuisanceFor
|
|||
}
|
||||
report, err := platform.PublicReportNuisanceCreate(ctx, setter_report, setter_nuisance, n.Location, n.Address, uploads)
|
||||
if err != nil {
|
||||
if errors.Is(err, platform.ErrNoAddress) {
|
||||
return nil, nhttp.NewBadRequest("empty-address")
|
||||
}
|
||||
return nil, nhttp.NewError("create nuisance report: %w", err)
|
||||
}
|
||||
uri, err := res.router.IDStrToURI("publicreport.ByIDGetPublic", report.PublicID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue