From f9fd9428fc13af1e95bb326e4fad6de1e70c8091 Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Tue, 6 Nov 2018 13:37:04 +0100 Subject: [PATCH] fix(crm): update url links to match params --- crm/docs/README.md | 20 ++++++++++---------- crm/docs/src/spec.json | 20 ++++++++++---------- crm/docs/src/spec/field.json | 2 +- crm/docs/src/spec/module.json | 12 ++++++------ crm/docs/src/spec/page.json | 6 +++--- crm/rest/handlers/field.go | 2 +- crm/rest/handlers/module.go | 12 ++++++------ crm/rest/handlers/page.go | 6 +++--- 8 files changed, 40 insertions(+), 40 deletions(-) diff --git a/crm/docs/README.md b/crm/docs/README.md index 391a317ee..eba64915d 100644 --- a/crm/docs/README.md +++ b/crm/docs/README.md @@ -21,7 +21,7 @@ CRM input field definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/field/{id}` | HTTP/S | GET | | +| `/field/{typeID}` | HTTP/S | GET | | #### Request parameters @@ -71,7 +71,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{id}` | HTTP/S | GET | | +| `/module/{moduleID}` | HTTP/S | GET | | #### Request parameters @@ -85,7 +85,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{id}` | HTTP/S | POST | | +| `/module/{moduleID}` | HTTP/S | POST | | #### Request parameters @@ -101,7 +101,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{id}` | HTTP/S | DELETE | | +| `/module/{moduleID}` | HTTP/S | DELETE | | #### Request parameters @@ -146,7 +146,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{moduleID}/content/{id}` | HTTP/S | GET | | +| `/module/{moduleID}/content/{contentID}` | HTTP/S | GET | | #### Request parameters @@ -161,7 +161,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{moduleID}/content/{id}` | HTTP/S | POST | | +| `/module/{moduleID}/content/{contentID}` | HTTP/S | POST | | #### Request parameters @@ -177,7 +177,7 @@ CRM module definitions | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/module/{moduleID}/content/{id}` | HTTP/S | DELETE | | +| `/module/{moduleID}/content/{contentID}` | HTTP/S | DELETE | | #### Request parameters @@ -232,7 +232,7 @@ CRM module pages | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/page/{id}` | HTTP/S | GET | | +| `/page/{pageID}` | HTTP/S | GET | | #### Request parameters @@ -246,7 +246,7 @@ CRM module pages | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/page/{id}` | HTTP/S | POST | | +| `/page/{pageID}` | HTTP/S | POST | | #### Request parameters @@ -281,7 +281,7 @@ CRM module pages | URI | Protocol | Method | Authentication | | --- | -------- | ------ | -------------- | -| `/page/{id}` | HTTP/S | Delete | | +| `/page/{pageID}` | HTTP/S | Delete | | #### Request parameters diff --git a/crm/docs/src/spec.json b/crm/docs/src/spec.json index b4bc2d36b..65034fd52 100644 --- a/crm/docs/src/spec.json +++ b/crm/docs/src/spec.json @@ -38,7 +38,7 @@ }, { "name": "type", - "path": "/{id}", + "path": "/{typeID}", "method": "GET", "title": "Get field details", "parameters": { @@ -127,7 +127,7 @@ }, { "name": "read", - "path": "/{id}", + "path": "/{pageID}", "method": "GET", "title": "Get page details", "parameters": { @@ -145,7 +145,7 @@ "name": "edit", "method": "POST", "title": "Create page", - "path": "/{id}", + "path": "/{pageID}", "parameters": { "path": [ { @@ -221,7 +221,7 @@ }, { "name": "delete", - "path": "/{id}", + "path": "/{pageID}", "method": "Delete", "title": "Delete page", "parameters": { @@ -357,7 +357,7 @@ "name": "read", "method": "GET", "title": "Read module", - "path": "/{id}", + "path": "/{moduleID}", "parameters": { "path": [ { @@ -373,7 +373,7 @@ "name": "edit", "method": "POST", "title": "Edit module", - "path": "/{id}", + "path": "/{moduleID}", "parameters": { "path": [ { @@ -403,7 +403,7 @@ "name": "delete", "method": "DELETE", "title": "Delete module", - "path": "/{id}", + "path": "/{moduleID}", "parameters": { "path": [ { @@ -473,7 +473,7 @@ "name": "content/read", "method": "GET", "title": "Read contents by ID from module section", - "path": "/{moduleID}/content/{id}", + "path": "/{moduleID}/content/{contentID}", "parameters": { "path": [ { @@ -495,7 +495,7 @@ "name": "content/edit", "method": "POST", "title": "Add/update contents in module section", - "path": "/{moduleID}/content/{id}", + "path": "/{moduleID}/content/{contentID}", "parameters": { "path": [ { @@ -525,7 +525,7 @@ "name": "content/delete", "method": "DELETE", "title": "Delete content row from module section", - "path": "/{moduleID}/content/{id}", + "path": "/{moduleID}/content/{contentID}", "parameters": { "path": [ { diff --git a/crm/docs/src/spec/field.json b/crm/docs/src/spec/field.json index 304c3470c..f63893c0d 100644 --- a/crm/docs/src/spec/field.json +++ b/crm/docs/src/spec/field.json @@ -42,7 +42,7 @@ "Name": "type", "Method": "GET", "Title": "Get field details", - "Path": "/{id}", + "Path": "/{typeID}", "Parameters": { "path": [ { diff --git a/crm/docs/src/spec/module.json b/crm/docs/src/spec/module.json index 13ace9e42..ab54ef50b 100644 --- a/crm/docs/src/spec/module.json +++ b/crm/docs/src/spec/module.json @@ -120,7 +120,7 @@ "Name": "read", "Method": "GET", "Title": "Read module", - "Path": "/{id}", + "Path": "/{moduleID}", "Parameters": { "path": [ { @@ -136,7 +136,7 @@ "Name": "edit", "Method": "POST", "Title": "Edit module", - "Path": "/{id}", + "Path": "/{moduleID}", "Parameters": { "path": [ { @@ -166,7 +166,7 @@ "Name": "delete", "Method": "DELETE", "Title": "Delete module", - "Path": "/{id}", + "Path": "/{moduleID}", "Parameters": { "path": [ { @@ -236,7 +236,7 @@ "Name": "content/read", "Method": "GET", "Title": "Read contents by ID from module section", - "Path": "/{moduleID}/content/{id}", + "Path": "/{moduleID}/content/{contentID}", "Parameters": { "path": [ { @@ -258,7 +258,7 @@ "Name": "content/edit", "Method": "POST", "Title": "Add/update contents in module section", - "Path": "/{moduleID}/content/{id}", + "Path": "/{moduleID}/content/{contentID}", "Parameters": { "path": [ { @@ -288,7 +288,7 @@ "Name": "content/delete", "Method": "DELETE", "Title": "Delete content row from module section", - "Path": "/{moduleID}/content/{id}", + "Path": "/{moduleID}/content/{contentID}", "Parameters": { "path": [ { diff --git a/crm/docs/src/spec/page.json b/crm/docs/src/spec/page.json index c081b1b6d..94576b596 100644 --- a/crm/docs/src/spec/page.json +++ b/crm/docs/src/spec/page.json @@ -75,7 +75,7 @@ "Name": "read", "Method": "GET", "Title": "Get page details", - "Path": "/{id}", + "Path": "/{pageID}", "Parameters": { "path": [ { @@ -91,7 +91,7 @@ "Name": "edit", "Method": "POST", "Title": "Create page", - "Path": "/{id}", + "Path": "/{pageID}", "Parameters": { "path": [ { @@ -169,7 +169,7 @@ "Name": "delete", "Method": "Delete", "Title": "Delete page", - "Path": "/{id}", + "Path": "/{pageID}", "Parameters": { "path": [ { diff --git a/crm/rest/handlers/field.go b/crm/rest/handlers/field.go index e946cefa1..cb63b05ec 100644 --- a/crm/rest/handlers/field.go +++ b/crm/rest/handlers/field.go @@ -61,7 +61,7 @@ func (fh *Field) MountRoutes(r chi.Router, middlewares ...func(http.Handler) htt r.Use(middlewares...) r.Route("/field", func(r chi.Router) { r.Get("/", fh.List) - r.Get("/{id}", fh.Type) + r.Get("/{typeID}", fh.Type) }) }) } diff --git a/crm/rest/handlers/module.go b/crm/rest/handlers/module.go index 5f1fd8f97..503a29632 100644 --- a/crm/rest/handlers/module.go +++ b/crm/rest/handlers/module.go @@ -134,14 +134,14 @@ func (mh *Module) MountRoutes(r chi.Router, middlewares ...func(http.Handler) ht r.Route("/module", func(r chi.Router) { r.Get("/", mh.List) r.Post("/", mh.Create) - r.Get("/{id}", mh.Read) - r.Post("/{id}", mh.Edit) - r.Delete("/{id}", mh.Delete) + r.Get("/{moduleID}", mh.Read) + r.Post("/{moduleID}", mh.Edit) + r.Delete("/{moduleID}", mh.Delete) r.Get("/{moduleID}/content", mh.ContentList) r.Post("/{moduleID}/content", mh.ContentCreate) - r.Get("/{moduleID}/content/{id}", mh.ContentRead) - r.Post("/{moduleID}/content/{id}", mh.ContentEdit) - r.Delete("/{moduleID}/content/{id}", mh.ContentDelete) + r.Get("/{moduleID}/content/{contentID}", mh.ContentRead) + r.Post("/{moduleID}/content/{contentID}", mh.ContentEdit) + r.Delete("/{moduleID}/content/{contentID}", mh.ContentDelete) }) }) } diff --git a/crm/rest/handlers/page.go b/crm/rest/handlers/page.go index ef2e707c2..dd12051f9 100644 --- a/crm/rest/handlers/page.go +++ b/crm/rest/handlers/page.go @@ -98,10 +98,10 @@ func (ph *Page) MountRoutes(r chi.Router, middlewares ...func(http.Handler) http r.Route("/page", func(r chi.Router) { r.Get("/", ph.List) r.Post("/", ph.Create) - r.Get("/{id}", ph.Read) - r.Post("/{id}", ph.Edit) + r.Get("/{pageID}", ph.Read) + r.Post("/{pageID}", ph.Edit) r.Post("/{selfID}/reorder", ph.Reorder) - r.Delete("/{id}", ph.Delete) + r.Delete("/{pageID}", ph.Delete) }) }) }