3
0

Fix page ordering by exposing weight

This commit is contained in:
Tomaž Jerman
2020-03-17 21:30:51 +01:00
parent 612312c4ca
commit 845dc2c4de
5 changed files with 10 additions and 1 deletions
+6
View File
@@ -385,6 +385,12 @@
"required": false,
"title": "Description"
},
{
"type": "int",
"name": "weight",
"required": false,
"title": "Page tree weight"
},
{
"type": "bool",
"name": "visible",
+1
View File
@@ -121,6 +121,7 @@ func (ctrl *Page) Update(ctx context.Context, r *request.PageUpdate) (interface{
Handle: r.Handle,
Description: r.Description,
Visible: r.Visible,
Weight: r.Weight,
}
)
+1
View File
@@ -316,6 +316,7 @@ type PageUpdate struct {
Title string
Handle string
Description string
Weight int
Visible bool
Blocks sqlxTypes.JSONText
}
+1
View File
@@ -2,6 +2,7 @@ package service
import (
"context"
"github.com/titpetric/factory"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
+1 -1
View File
@@ -30,7 +30,7 @@ type (
Children PageSet `json:"children,omitempty" db:"-"`
Visible bool `json:"visible" db:"visible"`
Weight int `json:"-" db:"weight"`
Weight int `json:"weight" db:"weight"`
CreatedAt time.Time `db:"created_at" json:"createdAt,omitempty"`
UpdatedAt *time.Time `db:"updated_at" json:"updatedAt,omitempty"`