Add full support for handle on module/chart/page

This commit is contained in:
Denis Arh
2019-09-30 10:20:39 +02:00
parent 40ab1e22ea
commit 6535034d87
20 changed files with 231 additions and 59 deletions
+54
View File
@@ -207,6 +207,12 @@
"required": false,
"title": "Search query"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Search by handle"
},
{
"name": "page",
"type": "uint",
@@ -247,6 +253,12 @@
"required": true,
"title": "Title"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Handle"
},
{
"type": "string",
"name": "description",
@@ -324,6 +336,12 @@
"required": true,
"title": "Title"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Handle"
},
{
"type": "string",
"name": "description",
@@ -456,6 +474,12 @@
"required": false,
"title": "Search by name"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Search by handle"
},
{
"name": "page",
"type": "uint",
@@ -484,6 +508,12 @@
"required": true,
"title": "Module Name"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Module handle"
},
{
"type": "types.ModuleFieldSet",
"name": "fields",
@@ -536,6 +566,12 @@
"required": true,
"title": "Module Name"
},
{
"type": "string",
"name": "handle",
"required": false,
"title": "Module Handle"
},
{
"type": "types.ModuleFieldSet",
"name": "fields",
@@ -928,6 +964,12 @@
"title": "Search query to match against charts",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Search charts by handle",
"type": "string"
},
{
"name": "page",
"type": "uint",
@@ -961,6 +1003,12 @@
"title": "Chart name",
"type": "string",
"required": true
},
{
"name": "handle",
"title": "Chart handle",
"type": "string",
"required": false
}
]
}
@@ -1008,6 +1056,12 @@
"type": "string",
"required": true
},
{
"name": "handle",
"title": "Chart handle",
"type": "string",
"required": false
},
{
"type": "*time.Time",
"name": "updatedAt",
+18
View File
@@ -36,6 +36,12 @@
"title": "Search query to match against charts",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Search charts by handle",
"type": "string"
},
{
"name": "page",
"required": false,
@@ -69,6 +75,12 @@
"required": true,
"title": "Chart name",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Chart handle",
"type": "string"
}
]
}
@@ -116,6 +128,12 @@
"title": "Chart name",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Chart handle",
"type": "string"
},
{
"name": "updatedAt",
"required": false,
+18
View File
@@ -44,6 +44,12 @@
"title": "Search by name",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Search by handle",
"type": "string"
},
{
"name": "page",
"required": false,
@@ -72,6 +78,12 @@
"title": "Module Name",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Module handle",
"type": "string"
},
{
"name": "fields",
"required": true,
@@ -124,6 +136,12 @@
"title": "Module Name",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Module Handle",
"type": "string"
},
{
"name": "fields",
"required": true,
+18
View File
@@ -42,6 +42,12 @@
"title": "Search query",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Search by handle",
"type": "string"
},
{
"name": "page",
"required": false,
@@ -82,6 +88,12 @@
"title": "Title",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Handle",
"type": "string"
},
{
"name": "description",
"required": false,
@@ -159,6 +171,12 @@
"title": "Title",
"type": "string"
},
{
"name": "handle",
"required": false,
"title": "Handle",
"type": "string"
},
{
"name": "description",
"required": false,
+19 -21
View File
@@ -2,6 +2,7 @@ package repository
import (
"context"
"strings"
"time"
"github.com/titpetric/factory"
@@ -61,35 +62,28 @@ func (r chart) query() squirrel.SelectBuilder {
}
func (r chart) FindByID(namespaceID, chartID uint64) (*types.Chart, error) {
var (
query = r.query().
Columns(r.columns()...).
Where("id = ?", chartID)
c = &types.Chart{}
)
if namespaceID > 0 {
query = query.Where("rel_namespace = ?", namespaceID)
}
return c, isFound(r.fetchOne(c, query), c.ID > 0, ErrChartNotFound)
return r.findOneBy(namespaceID, "id", chartID)
}
func (r chart) FindByHandle(namespaceID uint64, handle string) (*types.Chart, error) {
var (
query = r.query().
Columns(r.columns()...).
Where("handle = ?", handle)
return r.findOneBy(namespaceID, "LOWER(handle)", strings.ToLower(strings.TrimSpace(handle)))
}
c = &types.Chart{}
func (r chart) findOneBy(namespaceID uint64, field string, value interface{}) (*types.Chart, error) {
var c = &types.Chart{}
err := r.findOneInNamespaceBy(
namespaceID,
r.query().Columns(r.columns()...),
squirrel.Eq{field: value},
c,
)
if namespaceID > 0 {
query = query.Where("rel_namespace = ?", namespaceID)
if err == nil && c.ID == 0 {
return nil, ErrChartNotFound
}
return c, isFound(r.fetchOne(c, query), c.ID > 0, ErrChartNotFound)
return c, nil
}
func (r chart) Find(filter types.ChartFilter) (set types.ChartSet, f types.ChartFilter, err error) {
@@ -106,6 +100,10 @@ func (r chart) Find(filter types.ChartFilter) (set types.ChartSet, f types.Chart
query = query.Where("name like ?", q)
}
if f.Handle != "" {
query = query.Where("LOWER(handle) = ?", strings.ToLower(f.Handle))
}
if f.Count, err = r.count(query); err != nil || f.Count == 0 {
return
}
+3
View File
@@ -117,7 +117,10 @@ func (r module) Find(filter types.ModuleFilter) (set types.ModuleSet, f types.Mo
if f.Name != "" {
query = query.Where("LOWER(name) = ?", strings.ToLower(f.Name))
}
if f.Handle != "" {
query = query.Where("LOWER(handle) = ?", strings.ToLower(f.Handle))
}
if f.Count, err = r.count(query); err != nil || f.Count == 0 {
+20 -34
View File
@@ -2,6 +2,7 @@ package repository
import (
"context"
"strings"
"time"
"github.com/titpetric/factory"
@@ -67,51 +68,32 @@ func (r page) query() squirrel.SelectBuilder {
}
func (r page) FindByID(namespaceID, pageID uint64) (*types.Page, error) {
var (
query = r.query().
Columns(r.columns()...).
Where("id = ?", pageID)
c = &types.Page{}
)
if namespaceID > 0 {
query = query.Where("rel_namespace = ?", namespaceID)
}
return c, isFound(r.fetchOne(c, query), c.ID > 0, ErrPageNotFound)
return r.findOneBy(namespaceID, "id", pageID)
}
func (r page) FindByHandle(namespaceID uint64, handle string) (*types.Page, error) {
var (
query = r.query().
Columns(r.columns()...).
Where("handle = ?", handle)
c = &types.Page{}
)
if namespaceID > 0 {
query = query.Where("rel_namespace = ?", namespaceID)
}
return c, isFound(r.fetchOne(c, query), c.ID > 0, ErrPageNotFound)
return r.findOneBy(namespaceID, "handle", handle)
}
func (r page) FindByModuleID(namespaceID, moduleID uint64) (*types.Page, error) {
var (
query = r.query().
Columns(r.columns()...).
Where("rel_module = ?", moduleID)
return r.findOneBy(namespaceID, "rel_module", moduleID)
}
c = &types.Page{}
func (r page) findOneBy(namespaceID uint64, field string, value interface{}) (*types.Page, error) {
var p = &types.Page{}
err := r.findOneInNamespaceBy(
namespaceID,
r.query().Columns(r.columns()...),
squirrel.Eq{field: value},
p,
)
if namespaceID > 0 {
query = query.Where("rel_namespace = ?", namespaceID)
if err == nil && p.ID == 0 {
return nil, ErrPageNotFound
}
return c, isFound(r.fetchOne(c, query), c.ID > 0, ErrPageNotFound)
return p, nil
}
func (r page) Find(filter types.PageFilter) (set types.PageSet, f types.PageFilter, err error) {
@@ -129,6 +111,10 @@ func (r page) Find(filter types.PageFilter) (set types.PageSet, f types.PageFilt
query = query.Where("self_id = 0")
}
if f.Handle != "" {
query = query.Where("LOWER(handle) = ?", strings.ToLower(f.Handle))
}
if f.Query != "" {
q := "%" + f.Query + "%"
query = query.Where("title LIKE ? OR description LIKE ?", q, q)
+3
View File
@@ -52,6 +52,7 @@ func (ctrl Chart) List(ctx context.Context, r *request.ChartList) (interface{},
f := types.ChartFilter{
NamespaceID: r.NamespaceID,
Handle: r.Handle,
Query: r.Query,
PerPage: r.PerPage,
Page: r.Page,
@@ -66,6 +67,7 @@ func (ctrl Chart) Create(ctx context.Context, r *request.ChartCreate) (interface
mod := &types.Chart{
NamespaceID: r.NamespaceID,
Name: r.Name,
Handle: r.Handle,
}
if err = r.Config.Unmarshal(&mod.Config); err != nil {
@@ -88,6 +90,7 @@ func (ctrl Chart) Update(ctx context.Context, r *request.ChartUpdate) (interface
mod = &types.Chart{
ID: r.ChartID,
Name: r.Name,
Handle: r.Handle,
NamespaceID: r.NamespaceID,
UpdatedAt: r.UpdatedAt,
}
+3
View File
@@ -73,6 +73,7 @@ func (ctrl *Module) List(ctx context.Context, r *request.ModuleList) (interface{
NamespaceID: r.NamespaceID,
Query: r.Query,
Name: r.Name,
Handle: r.Handle,
PerPage: r.PerPage,
Page: r.Page,
}
@@ -92,6 +93,7 @@ func (ctrl *Module) Create(ctx context.Context, r *request.ModuleCreate) (interf
mod = &types.Module{
NamespaceID: r.NamespaceID,
Name: r.Name,
Handle: r.Handle,
Fields: r.Fields,
Meta: r.Meta,
}
@@ -108,6 +110,7 @@ func (ctrl *Module) Update(ctx context.Context, r *request.ModuleUpdate) (interf
ID: r.ModuleID,
NamespaceID: r.NamespaceID,
Name: r.Name,
Handle: r.Handle,
Fields: r.Fields,
Meta: r.Meta,
UpdatedAt: r.UpdatedAt,
+3
View File
@@ -54,6 +54,7 @@ func (ctrl *Page) List(ctx context.Context, r *request.PageList) (interface{}, e
NamespaceID: r.NamespaceID,
ParentID: r.SelfID,
Handle: r.Handle,
Query: r.Query,
PerPage: r.PerPage,
Page: r.Page,
@@ -76,6 +77,7 @@ func (ctrl *Page) Create(ctx context.Context, r *request.PageCreate) (interface{
SelfID: r.SelfID,
ModuleID: r.ModuleID,
Title: r.Title,
Handle: r.Handle,
Description: r.Description,
Visible: r.Visible,
}
@@ -108,6 +110,7 @@ func (ctrl *Page) Update(ctx context.Context, r *request.PageUpdate) (interface{
SelfID: r.SelfID,
ModuleID: r.ModuleID,
Title: r.Title,
Handle: r.Handle,
Description: r.Description,
Visible: r.Visible,
}
+15
View File
@@ -36,6 +36,7 @@ var _ = multipart.FileHeader{}
// Chart list request parameters
type ChartList struct {
Query string
Handle string
Page uint
PerPage uint
NamespaceID uint64 `json:",string"`
@@ -49,6 +50,7 @@ func (r ChartList) Auditable() map[string]interface{} {
var out = map[string]interface{}{}
out["query"] = r.Query
out["handle"] = r.Handle
out["page"] = r.Page
out["perPage"] = r.PerPage
out["namespaceID"] = r.NamespaceID
@@ -86,6 +88,9 @@ func (r *ChartList) Fill(req *http.Request) (err error) {
if val, ok := get["query"]; ok {
r.Query = val
}
if val, ok := get["handle"]; ok {
r.Handle = val
}
if val, ok := get["page"]; ok {
r.Page = parseUint(val)
}
@@ -103,6 +108,7 @@ var _ RequestFiller = NewChartList()
type ChartCreate struct {
Config sqlxTypes.JSONText
Name string
Handle string
NamespaceID uint64 `json:",string"`
}
@@ -115,6 +121,7 @@ func (r ChartCreate) Auditable() map[string]interface{} {
out["config"] = r.Config
out["name"] = r.Name
out["handle"] = r.Handle
out["namespaceID"] = r.NamespaceID
return out
@@ -156,6 +163,9 @@ func (r *ChartCreate) Fill(req *http.Request) (err error) {
if val, ok := post["name"]; ok {
r.Name = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
r.NamespaceID = parseUInt64(chi.URLParam(req, "namespaceID"))
return err
@@ -223,6 +233,7 @@ type ChartUpdate struct {
NamespaceID uint64 `json:",string"`
Config sqlxTypes.JSONText
Name string
Handle string
UpdatedAt *time.Time
}
@@ -237,6 +248,7 @@ func (r ChartUpdate) Auditable() map[string]interface{} {
out["namespaceID"] = r.NamespaceID
out["config"] = r.Config
out["name"] = r.Name
out["handle"] = r.Handle
out["updatedAt"] = r.UpdatedAt
return out
@@ -280,6 +292,9 @@ func (r *ChartUpdate) Fill(req *http.Request) (err error) {
if val, ok := post["name"]; ok {
r.Name = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
if val, ok := post["updatedAt"]; ok {
if r.UpdatedAt, err = parseISODatePtrWithErr(val); err != nil {
+15
View File
@@ -38,6 +38,7 @@ var _ = multipart.FileHeader{}
type ModuleList struct {
Query string
Name string
Handle string
Page uint
PerPage uint
NamespaceID uint64 `json:",string"`
@@ -52,6 +53,7 @@ func (r ModuleList) Auditable() map[string]interface{} {
out["query"] = r.Query
out["name"] = r.Name
out["handle"] = r.Handle
out["page"] = r.Page
out["perPage"] = r.PerPage
out["namespaceID"] = r.NamespaceID
@@ -92,6 +94,9 @@ func (r *ModuleList) Fill(req *http.Request) (err error) {
if val, ok := get["name"]; ok {
r.Name = val
}
if val, ok := get["handle"]; ok {
r.Handle = val
}
if val, ok := get["page"]; ok {
r.Page = parseUint(val)
}
@@ -108,6 +113,7 @@ var _ RequestFiller = NewModuleList()
// Module create request parameters
type ModuleCreate struct {
Name string
Handle string
Fields types.ModuleFieldSet
Meta sqlxTypes.JSONText
NamespaceID uint64 `json:",string"`
@@ -121,6 +127,7 @@ func (r ModuleCreate) Auditable() map[string]interface{} {
var out = map[string]interface{}{}
out["name"] = r.Name
out["handle"] = r.Handle
out["fields"] = r.Fields
out["meta"] = r.Meta
out["namespaceID"] = r.NamespaceID
@@ -158,6 +165,9 @@ func (r *ModuleCreate) Fill(req *http.Request) (err error) {
if val, ok := post["name"]; ok {
r.Name = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
if val, ok := post["meta"]; ok {
if r.Meta, err = parseJSONTextWithErr(val); err != nil {
@@ -230,6 +240,7 @@ type ModuleUpdate struct {
ModuleID uint64 `json:",string"`
NamespaceID uint64 `json:",string"`
Name string
Handle string
Fields types.ModuleFieldSet
Meta sqlxTypes.JSONText
UpdatedAt *time.Time
@@ -245,6 +256,7 @@ func (r ModuleUpdate) Auditable() map[string]interface{} {
out["moduleID"] = r.ModuleID
out["namespaceID"] = r.NamespaceID
out["name"] = r.Name
out["handle"] = r.Handle
out["fields"] = r.Fields
out["meta"] = r.Meta
out["updatedAt"] = r.UpdatedAt
@@ -284,6 +296,9 @@ func (r *ModuleUpdate) Fill(req *http.Request) (err error) {
if val, ok := post["name"]; ok {
r.Name = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
if val, ok := post["meta"]; ok {
if r.Meta, err = parseJSONTextWithErr(val); err != nil {
+15
View File
@@ -36,6 +36,7 @@ var _ = multipart.FileHeader{}
type PageList struct {
SelfID uint64 `json:",string"`
Query string
Handle string
Page uint
PerPage uint
NamespaceID uint64 `json:",string"`
@@ -50,6 +51,7 @@ func (r PageList) Auditable() map[string]interface{} {
out["selfID"] = r.SelfID
out["query"] = r.Query
out["handle"] = r.Handle
out["page"] = r.Page
out["perPage"] = r.PerPage
out["namespaceID"] = r.NamespaceID
@@ -90,6 +92,9 @@ func (r *PageList) Fill(req *http.Request) (err error) {
if val, ok := get["query"]; ok {
r.Query = val
}
if val, ok := get["handle"]; ok {
r.Handle = val
}
if val, ok := get["page"]; ok {
r.Page = parseUint(val)
}
@@ -108,6 +113,7 @@ type PageCreate struct {
SelfID uint64 `json:",string"`
ModuleID uint64 `json:",string"`
Title string
Handle string
Description string
Visible bool
Blocks sqlxTypes.JSONText
@@ -124,6 +130,7 @@ func (r PageCreate) Auditable() map[string]interface{} {
out["selfID"] = r.SelfID
out["moduleID"] = r.ModuleID
out["title"] = r.Title
out["handle"] = r.Handle
out["description"] = r.Description
out["visible"] = r.Visible
out["blocks"] = r.Blocks
@@ -168,6 +175,9 @@ func (r *PageCreate) Fill(req *http.Request) (err error) {
if val, ok := post["title"]; ok {
r.Title = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
if val, ok := post["description"]; ok {
r.Description = val
}
@@ -299,6 +309,7 @@ type PageUpdate struct {
SelfID uint64 `json:",string"`
ModuleID uint64 `json:",string"`
Title string
Handle string
Description string
Visible bool
Blocks sqlxTypes.JSONText
@@ -316,6 +327,7 @@ func (r PageUpdate) Auditable() map[string]interface{} {
out["selfID"] = r.SelfID
out["moduleID"] = r.ModuleID
out["title"] = r.Title
out["handle"] = r.Handle
out["description"] = r.Description
out["visible"] = r.Visible
out["blocks"] = r.Blocks
@@ -361,6 +373,9 @@ func (r *PageUpdate) Fill(req *http.Request) (err error) {
if val, ok := post["title"]; ok {
r.Title = val
}
if val, ok := post["handle"]; ok {
r.Handle = val
}
if val, ok := post["description"]; ok {
r.Description = val
}
+1
View File
@@ -154,6 +154,7 @@ func (svc chart) Update(mod *types.Chart) (c *types.Chart, err error) {
c.Config = mod.Config
c.Name = mod.Name
c.Handle = mod.Handle
return svc.chartRepo.Update(c)
}
+1
View File
@@ -188,6 +188,7 @@ func (svc module) Update(mod *types.Module) (m *types.Module, err error) {
}
m.Name = mod.Name
m.Handle = mod.Handle
m.Meta = mod.Meta
m.Fields = mod.Fields
+13 -4
View File
@@ -3,6 +3,7 @@ package service
import (
"context"
"github.com/davecgh/go-spew/spew"
"github.com/titpetric/factory"
"go.uber.org/zap"
@@ -250,18 +251,20 @@ func (svc page) Update(mod *types.Page) (p *types.Page, err error) {
return nil, ErrNoUpdatePermissions.withStack()
}
if err = svc.UniqueCheck(mod); err != nil {
return
}
p.ModuleID = mod.ModuleID
p.SelfID = mod.SelfID
p.Blocks = mod.Blocks
p.Title = mod.Title
p.Handle = mod.Handle
p.Description = mod.Description
p.Visible = mod.Visible
p.Weight = mod.Weight
spew.Dump(p.Handle)
if err = svc.UniqueCheck(p); err != nil {
return
}
p, err = svc.pageRepo.Update(p)
return
}
@@ -269,6 +272,12 @@ func (svc page) Update(mod *types.Page) (p *types.Page, err error) {
func (svc page) UniqueCheck(p *types.Page) (err error) {
if p.Handle != "" {
if e, _ := svc.pageRepo.FindByHandle(p.NamespaceID, p.Handle); e != nil && e.ID != p.ID {
spew.Dump(
e.ID,
e.Handle,
p.ID,
p.Handle,
)
return repository.ErrPageHandleNotUnique
}
}
+1
View File
@@ -41,6 +41,7 @@ type (
ChartFilter struct {
NamespaceID uint64 `json:"namespaceID,string"`
Handle string `json:"handle"`
Query string `json:"query"`
Page uint `json:"page"`
PerPage uint `json:"perPage"`
+1
View File
@@ -25,6 +25,7 @@ type (
ModuleFilter struct {
NamespaceID uint64 `json:"namespaceID,string"`
Query string `json:"query"`
Handle string `json:"handle"`
Name string `json:"name"`
Page uint `json:"page"`
PerPage uint `json:"perPage"`
+1
View File
@@ -58,6 +58,7 @@ type (
NamespaceID uint64 `json:"namespaceID,string"`
ParentID uint64 `json:"parentID,string,omitempty"`
Root bool `json:"root,omitempty"`
Handle string `json:"handle"`
Query string `json:"query"`
Page uint `json:"page"`
PerPage uint `json:"perPage"`
+9
View File
@@ -407,6 +407,7 @@
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| query | string | GET | Search query to match against charts | N/A | NO |
| handle | string | GET | Search charts by handle | N/A | NO |
| page | uint | GET | Page number (0 based) | N/A | NO |
| perPage | uint | GET | Returned items per page (default 50) | N/A | NO |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
@@ -425,6 +426,7 @@
| --------- | ---- | ------ | ----------- | ------- | --------- |
| config | sqlxTypes.JSONText | POST | Chart JSON | N/A | YES |
| name | string | POST | Chart name | N/A | YES |
| handle | string | POST | Chart handle | N/A | NO |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
## Read charts by ID
@@ -458,6 +460,7 @@
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
| config | sqlxTypes.JSONText | POST | Chart JSON | N/A | YES |
| name | string | POST | Chart name | N/A | YES |
| handle | string | POST | Chart handle | N/A | NO |
| updatedAt | *time.Time | POST | Last update (or creation) date | N/A | NO |
## Delete chart
@@ -506,6 +509,7 @@ Compose module definitions
| --------- | ---- | ------ | ----------- | ------- | --------- |
| query | string | GET | Search query | N/A | NO |
| name | string | GET | Search by name | N/A | NO |
| handle | string | GET | Search by handle | N/A | NO |
| page | uint | GET | Page number (0 based) | N/A | NO |
| perPage | uint | GET | Returned items per page (default 50) | N/A | NO |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
@@ -523,6 +527,7 @@ Compose module definitions
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
| name | string | POST | Module Name | N/A | YES |
| handle | string | POST | Module handle | N/A | NO |
| fields | types.ModuleFieldSet | POST | Fields JSON | N/A | YES |
| meta | sqlxTypes.JSONText | POST | Module meta data | N/A | YES |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
@@ -557,6 +562,7 @@ Compose module definitions
| moduleID | uint64 | PATH | Module ID | N/A | YES |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
| name | string | POST | Module Name | N/A | YES |
| handle | string | POST | Module Handle | N/A | NO |
| fields | types.ModuleFieldSet | POST | Fields JSON | N/A | YES |
| meta | sqlxTypes.JSONText | POST | Module meta data | N/A | YES |
| updatedAt | *time.Time | POST | Last update (or creation) date | N/A | NO |
@@ -738,6 +744,7 @@ Compose pages
| --------- | ---- | ------ | ----------- | ------- | --------- |
| selfID | uint64 | GET | Parent page ID | N/A | NO |
| query | string | GET | Search query | N/A | NO |
| handle | string | GET | Search by handle | N/A | NO |
| page | uint | GET | Page number (0 based) | N/A | NO |
| perPage | uint | GET | Returned items per page (default 50) | N/A | NO |
| namespaceID | uint64 | PATH | Namespace ID | N/A | YES |
@@ -757,6 +764,7 @@ Compose pages
| selfID | uint64 | POST | Parent Page ID | N/A | NO |
| moduleID | uint64 | POST | Module ID | N/A | NO |
| title | string | POST | Title | N/A | YES |
| handle | string | POST | Handle | N/A | NO |
| description | string | POST | Description | N/A | NO |
| visible | bool | POST | Visible in navigation | N/A | NO |
| blocks | sqlxTypes.JSONText | POST | Blocks JSON | N/A | YES |
@@ -808,6 +816,7 @@ Compose pages
| selfID | uint64 | POST | Parent Page ID | N/A | NO |
| moduleID | uint64 | POST | Module ID (optional) | N/A | NO |
| title | string | POST | Title | N/A | YES |
| handle | string | POST | Handle | N/A | NO |
| description | string | POST | Description | N/A | NO |
| visible | bool | POST | Visible in navigation | N/A | NO |
| blocks | sqlxTypes.JSONText | POST | Blocks JSON | N/A | YES |