Query history: Save user preferences in database (#47506)

This commit is contained in:
Ivana Huckova
2022-04-12 11:42:42 +02:00
committed by GitHub
parent cfaf058b20
commit 201557c6fc
4 changed files with 58 additions and 22 deletions
+2
View File
@@ -53,6 +53,7 @@ func (hs *HTTPServer) getPreferencesFor(ctx context.Context, orgID, userID, team
if prefsQuery.Result.JsonData != nil {
dto.Navbar = prefsQuery.Result.JsonData.Navbar
dto.QueryHistory = prefsQuery.Result.JsonData.QueryHistory
}
return response.JSON(200, &dto)
@@ -110,6 +111,7 @@ func (hs *HTTPServer) patchPreferencesFor(ctx context.Context, orgID, userID, te
WeekStart: dtoCmd.WeekStart,
HomeDashboardId: dtoCmd.HomeDashboardID,
Navbar: dtoCmd.Navbar,
QueryHistory: dtoCmd.QueryHistory,
}
if err := hs.SQLStore.PatchPreferences(ctx, &patchCmd); err != nil {