NOTE: this doesn't need a swagger definition since AGPL already has one, and this route overrides the AGPL one.
(rw http.ResponseWriter, r *http.Request)
| 51 | // NOTE: this doesn't need a swagger definition since AGPL already has one, and |
| 52 | // this route overrides the AGPL one. |
| 53 | func (api *API) regions(rw http.ResponseWriter, r *http.Request) { |
| 54 | regions, err := api.fetchRegions(r.Context()) |
| 55 | if err != nil { |
| 56 | httpapi.InternalServerError(rw, err) |
| 57 | return |
| 58 | } |
| 59 | |
| 60 | httpapi.Write(r.Context(), rw, http.StatusOK, regions) |
| 61 | } |
| 62 | |
| 63 | func (api *API) fetchRegions(ctx context.Context) (codersdk.RegionsResponse[codersdk.Region], error) { |
| 64 | //nolint:gocritic // this intentionally requests resources that users |
nothing calls this directly
no test coverage detected