feat(preferences): lots of refactoring and changes to #3214

This commit is contained in:
Torkel Ödegaard
2016-03-15 22:49:52 +01:00
parent e06756bcab
commit a88176e060
7 changed files with 66 additions and 102 deletions
+7
View File
@@ -0,0 +1,7 @@
package dtos
type Preferences struct {
Theme string `json:"theme"`
HomeDashboardId int64 `json:"homeDashboardId"`
Timezone string `json:"timezone"`
}
+5 -5
View File
@@ -1,6 +1,7 @@
package api
import (
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/middleware"
m "github.com/grafana/grafana/pkg/models"
@@ -29,11 +30,10 @@ func GetPreferences(c *middleware.Context) {
c.JsonApiErr(500, "Failed to get preferences", err)
}
dto := m.PreferencesDTO{
Id: query.Result.Id,
UserId: query.Result.UserId,
OrgId: query.Result.OrgId,
Preference: query.Result.Preference,
dto := dtos.Preferences{
HomeDashboardId: query.Result.HomeDashboardId,
Timezone: query.Result.Timezone,
Theme: query.Result.Theme,
}
c.JSON(200, dto)