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

Method getChatDiffContents

coderd/exp_chats.go:3762–3776  ·  view source on GitHub ↗

EXPERIMENTAL: this endpoint is experimental and is subject to change. @Summary Get chat diff contents @ID get-chat-diff-contents @Security CoderSessionToken @Tags Chats @Produce json @Param chat path string true "Chat ID" format(uuid) @Success 200 {object} codersdk.ChatDiffContents @Router /api/exp

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

3760//
3761//nolint:revive // HTTP handler writes to ResponseWriter.
3762func (api *API) getChatDiffContents(rw http.ResponseWriter, r *http.Request) {
3763 ctx := r.Context()
3764 chat := httpmw.ChatParam(r)
3765
3766 diff, err := api.resolveChatDiffContents(ctx, chat)
3767 if err != nil {
3768 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
3769 Message: "Failed to get chat diff.",
3770 Detail: err.Error(),
3771 })
3772 return
3773 }
3774
3775 httpapi.Write(ctx, rw, http.StatusOK, diff)
3776}
3777
3778// chatCreateWorkspace provides workspace creation for the chat
3779// processor. RBAC authorization uses context-based checks via

Callers 1

chatDiffContentsFunction · 0.80

Calls 5

ChatParamFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected