Preferences: Add API validation and update documentation (#116045)

This commit is contained in:
Stephanie Hingtgen
2026-01-09 03:57:15 -07:00
committed by GitHub
parent 368762c026
commit 5f8668b3aa
14 changed files with 142 additions and 44 deletions
+4
View File
@@ -20,6 +20,10 @@ func UpdatePreferencesFor(ctx context.Context,
return response.Error(http.StatusBadRequest, "Invalid theme", nil)
}
if !pref.IsValidTimezone(dtoCmd.Timezone) {
return response.Error(http.StatusBadRequest, "Invalid timezone. Must be a valid IANA timezone (e.g., America/New_York), 'utc', 'browser', or empty string", nil)
}
// convert dashboard UID to ID in order to store internally if it exists in the query, otherwise take the id from query
// nolint:staticcheck
dashboardID := dtoCmd.HomeDashboardID