Skip to content

Commit 07829e6

Browse files
committed
feat: add logs
1 parent 46a36a0 commit 07829e6

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

Diff for: services/core/api/user_layout.go

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type GetUserLayoutResponse struct {
1111
ID string `json:"id"`
1212
IsDefault bool `json:"is_default"`
1313
UserID string `json:"user_id"`
14-
Widgets []Widget `json:"widgets"`
14+
Widgets []WidgetResponse `json:"widgets"`
1515
Name string `json:"name"`
1616
Description string `json:"description"`
1717
UpdatedAt time.Time `json:"updated_at"`
@@ -29,6 +29,19 @@ type Widget struct {
2929
ColumnOffset int `json:"column_offset"`
3030
IsPublic bool `json:"is_public"`
3131
UserID string `json:"user_id"`
32+
33+
}
34+
type WidgetResponse struct {
35+
ID string `json:"id"`
36+
Title string `json:"title"`
37+
Description string `json:"description"`
38+
WidgetType string `json:"widget_type"`
39+
WidgetProps []map[string]any `json:"widget_props"`
40+
RowSpan int `json:"row_span"`
41+
ColumnSpan int `json:"column_span"`
42+
ColumnOffset int `json:"column_offset"`
43+
IsPublic bool `json:"is_public"`
44+
UserID string `json:"user_id"`
3245
CreatedAt time.Time `json:"created_at"`
3346
UpdatedAt time.Time `json:"updated_at"`
3447

@@ -40,7 +53,6 @@ type SetDashboardWithWidgetsRequest struct {
4053
Widgets []Widget `json:"widgets"`
4154
Name string `json:"name"`
4255
Description string `json:"description"`
43-
UpdatedAt time.Time `json:"updated_at"`
4456
IsPrivate bool `json:"is_private"`
4557

4658
}

Diff for: services/core/http_routes.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -1667,9 +1667,9 @@ func (h *HttpHandler) GetUserDefaultLayout(echoCtx echo.Context) error {
16671667
if layout == nil {
16681668
return echo.NewHTTPError(http.StatusNotFound, "default layout not found")
16691669
}
1670-
var widgets []api.Widget
1670+
var widgets []api.WidgetResponse
16711671
for _, widget := range layout.Widgets {
1672-
widgets = append(widgets, api.Widget{
1672+
widgets = append(widgets, api.WidgetResponse{
16731673
ID: widget.ID,
16741674
UserID: widget.UserID,
16751675
Title: widget.Title,
@@ -1769,9 +1769,9 @@ func (h *HttpHandler) GetPublicLayouts(echoCtx echo.Context) error {
17691769

17701770
var response []api.GetUserLayoutResponse
17711771
for _, layout := range layouts {
1772-
var widgets []api.Widget
1772+
var widgets []api.WidgetResponse
17731773
for _, widget := range layout.Widgets {
1774-
widgets = append(widgets, api.Widget{
1774+
widgets = append(widgets, api.WidgetResponse{
17751775
ID: widget.ID,
17761776
UserID: widget.UserID,
17771777
Title: widget.Title,

0 commit comments

Comments
 (0)