@Summary Get appearance @ID get-appearance @Security CoderSessionToken @Produce json @Tags Enterprise @Success 200 {object} codersdk.AppearanceConfig @Router /api/v2/appearance [get]
(rw http.ResponseWriter, r *http.Request)
| 28 | // @Success 200 {object} codersdk.AppearanceConfig |
| 29 | // @Router /api/v2/appearance [get] |
| 30 | func (api *API) appearance(rw http.ResponseWriter, r *http.Request) { |
| 31 | af := *api.AGPL.AppearanceFetcher.Load() |
| 32 | cfg, err := af.Fetch(r.Context()) |
| 33 | if err != nil { |
| 34 | httpapi.Write(r.Context(), rw, http.StatusInternalServerError, codersdk.Response{ |
| 35 | Message: "Failed to fetch appearance config.", |
| 36 | Detail: err.Error(), |
| 37 | }) |
| 38 | return |
| 39 | } |
| 40 | |
| 41 | httpapi.Write(r.Context(), rw, http.StatusOK, cfg) |
| 42 | } |
| 43 | |
| 44 | type appearanceFetcher struct { |
| 45 | database database.Store |