@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)
| 5483 | // |
| 5484 | //nolint:revive // get-return: revive assumes get* must be a getter, but this is an HTTP handler. |
| 5485 | func (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. |
no test coverage detected