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

Method getChatRetentionDays

coderd/exp_chats.go:5485–5498  ·  view source on GitHub ↗

@Summary Get chat retention days @ID get-chat-retention-days @Security CoderSessionToken @Tags Chats @Produce json @Success 200 {object} codersdk.ChatRetentionDaysResponse @Router /api/experimental/chats/config/retention-days [get] @x-apidocgen {"skip": true} nolint:revive // get-return: revive ass

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

Source from the content-addressed store, hash-verified

5483//
5484//nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler.
5485func (api *API) getChatRetentionDays(rw http.ResponseWriter, r *http.Request) {
5486 ctx := r.Context()
5487 retentionDays, err := api.Database.GetChatRetentionDays(ctx)
5488 if err != nil {
5489 httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
5490 Message: "Failed to get chat retention days.",
5491 Detail: err.Error(),
5492 })
5493 return
5494 }
5495 httpapi.Write(ctx, rw, http.StatusOK, codersdk.ChatRetentionDaysResponse{
5496 RetentionDays: retentionDays,
5497 })
5498}
5499
5500// Keep in sync with retentionDaysMaximum in
5501// site/src/pages/AgentsPage/AgentSettingsBehaviorPageView.tsx.

Callers 1

chatRetentionDaysFunction · 0.80

Calls 4

WriteFunction · 0.92
ContextMethod · 0.65
GetChatRetentionDaysMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected