Fix page ordering by exposing weight
This commit is contained in:
@@ -385,6 +385,12 @@
|
||||
"required": false,
|
||||
"title": "Description"
|
||||
},
|
||||
{
|
||||
"type": "int",
|
||||
"name": "weight",
|
||||
"required": false,
|
||||
"title": "Page tree weight"
|
||||
},
|
||||
{
|
||||
"type": "bool",
|
||||
"name": "visible",
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -316,6 +316,7 @@ type PageUpdate struct {
|
||||
Title string
|
||||
Handle string
|
||||
Description string
|
||||
Weight int
|
||||
Visible bool
|
||||
Blocks sqlxTypes.JSONText
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/titpetric/factory"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
|
||||
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user