Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
user report success on admin api (#2202)
Browse files Browse the repository at this point in the history
* user report success on admin api

* spellin
  • Loading branch information
mikehelmick authored Aug 18, 2021
1 parent d59fb54 commit f5c9507
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/controller/issueapi/handle_issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ func (c *Controller) decodeAndIssue(ctx context.Context, w http.ResponseWriter,
case http.StatusOK:
c.h.RenderJSON(w, http.StatusOK, res.IssueCodeResponse())
return
case http.StatusConflict:
// This only occurs on "user-report" types where the phone number collides with
// an already known one. In this case we just return "success" and don't
// actually do anything. This matches the other user-report code issue paths.
c.h.RenderJSON(w, http.StatusOK, &api.UserReportResponse{
ExpiresAt: res.IssueCodeResponse().ExpiresAt,
ExpiresAtTimestamp: res.IssueCodeResponse().ExpiresAtTimestamp,
})
return
default:
c.h.RenderJSON(w, res.HTTPCode, res.ErrorReturn)
return
Expand Down

0 comments on commit f5c9507

Please sign in to comment.