EXPERIMENTAL: this endpoint is experimental and is subject to change. nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
(rw http.ResponseWriter, r *http.Request)
| 5068 | // |
| 5069 | //nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler. |
| 5070 | func (api *API) getChatDesktopEnabled(rw http.ResponseWriter, r *http.Request) { |
| 5071 | ctx := r.Context() |
| 5072 | enabled, err := api.Database.GetChatDesktopEnabled(ctx) |
| 5073 | if err != nil { |
| 5074 | httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{ |
| 5075 | Message: "Internal error fetching desktop setting.", |
| 5076 | Detail: err.Error(), |
| 5077 | }) |
| 5078 | return |
| 5079 | } |
| 5080 | httpapi.Write(ctx, rw, http.StatusOK, codersdk.ChatDesktopEnabledResponse{ |
| 5081 | EnableDesktop: enabled, |
| 5082 | }) |
| 5083 | } |
| 5084 | |
| 5085 | // EXPERIMENTAL: this endpoint is experimental and is subject to change. |
| 5086 | func (api *API) putChatDesktopEnabled(rw http.ResponseWriter, r *http.Request) { |
no test coverage detected