MCPcopy Index your code
hub / github.com/coder/coder / getChatDesktopEnabled

Method getChatDesktopEnabled

coderd/exp_chats.go:5070–5083  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

5068//
5069//nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
5070func (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.
5086func (api *API) putChatDesktopEnabled(rw http.ResponseWriter, r *http.Request) {

Callers 1

chatDesktopEnabledFunction · 0.80

Calls 4

WriteFunction · 0.92
ContextMethod · 0.65
GetChatDesktopEnabledMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected