3
0

Add generated code for added page weight

This commit is contained in:
Denis Arh
2020-03-26 20:27:45 +01:00
parent 526a76dd71
commit 32ce2216cb
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -189,6 +189,12 @@
"title": "Description",
"type": "string"
},
{
"name": "weight",
"required": false,
"title": "Page tree weight",
"type": "int"
},
{
"name": "visible",
"required": false,
+4
View File
@@ -335,6 +335,7 @@ func (r PageUpdate) Auditable() map[string]interface{} {
out["title"] = r.Title
out["handle"] = r.Handle
out["description"] = r.Description
out["weight"] = r.Weight
out["visible"] = r.Visible
out["blocks"] = r.Blocks
@@ -385,6 +386,9 @@ func (r *PageUpdate) Fill(req *http.Request) (err error) {
if val, ok := post["description"]; ok {
r.Description = val
}
if val, ok := post["weight"]; ok {
r.Weight = parseInt(val)
}
if val, ok := post["visible"]; ok {
r.Visible = parseBool(val)
}