3
0

fix(crm): fix url path for content apis

This commit is contained in:
Tit Petric 2018-10-20 22:56:22 +02:00
parent 49ffcf3717
commit c6bc3ae53e
4 changed files with 20 additions and 20 deletions

View File

@ -202,7 +202,7 @@ CRM module definitions
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/module/{module}/content` | HTTP/S | GET | |
| `/module/{moduleID}/content` | HTTP/S | GET | |
#### Request parameters
@ -218,7 +218,7 @@ CRM module definitions
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/module/{module}/content` | HTTP/S | POST | |
| `/module/{moduleID}/content` | HTTP/S | POST | |
#### Request parameters
@ -233,7 +233,7 @@ CRM module definitions
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/module/{module}/content/{id}` | HTTP/S | GET | |
| `/module/{moduleID}/content/{id}` | HTTP/S | GET | |
#### Request parameters
@ -248,7 +248,7 @@ CRM module definitions
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/module/{module}/content/{id}` | HTTP/S | POST | |
| `/module/{moduleID}/content/{id}` | HTTP/S | POST | |
#### Request parameters
@ -264,7 +264,7 @@ CRM module definitions
| URI | Protocol | Method | Authentication |
| --- | -------- | ------ | -------------- |
| `/module/{module}/content/{id}` | HTTP/S | DELETE | |
| `/module/{moduleID}/content/{id}` | HTTP/S | DELETE | |
#### Request parameters

View File

@ -216,7 +216,7 @@
"name": "content/list",
"method": "GET",
"title": "List/read contents from module section",
"path": "/{module}/content",
"path": "/{moduleID}/content",
"parameters": {
"path": [
{ "type": "uint64", "name": "moduleID", "required": true, "title": "Module ID" }
@ -231,7 +231,7 @@
"name": "content/create",
"method": "POST",
"title": "List/read contents from module section",
"path": "/{module}/content",
"path": "/{moduleID}/content",
"parameters": {
"path": [
{ "type": "uint64", "name": "moduleID", "required": true, "title": "Module ID" }
@ -245,7 +245,7 @@
"name": "content/read",
"method": "GET",
"title": "Read contents by ID from module section",
"path": "/{module}/content/{id}",
"path": "/{moduleID}/content/{id}",
"parameters": {
"path": [
{ "type": "uint64", "name": "moduleID", "required": true, "title": "Module ID" },
@ -257,7 +257,7 @@
"name": "content/edit",
"method": "POST",
"title": "Add/update contents in module section",
"path": "/{module}/content/{id}",
"path": "/{moduleID}/content/{id}",
"parameters": {
"path": [
{ "type": "uint64", "name": "moduleID", "required": true, "title": "Module ID" },
@ -272,7 +272,7 @@
"name": "content/delete",
"method": "DELETE",
"title": "Delete content row from module section",
"path": "/{module}/content/{id}",
"path": "/{moduleID}/content/{id}",
"parameters": {
"path": [
{ "type": "uint64", "name": "moduleID", "required": true, "title": "Module ID" },

View File

@ -182,7 +182,7 @@
"Name": "content/list",
"Method": "GET",
"Title": "List/read contents from module section",
"Path": "/{module}/content",
"Path": "/{moduleID}/content",
"Parameters": {
"get": [
{
@ -212,7 +212,7 @@
"Name": "content/create",
"Method": "POST",
"Title": "List/read contents from module section",
"Path": "/{module}/content",
"Path": "/{moduleID}/content",
"Parameters": {
"path": [
{
@ -236,7 +236,7 @@
"Name": "content/read",
"Method": "GET",
"Title": "Read contents by ID from module section",
"Path": "/{module}/content/{id}",
"Path": "/{moduleID}/content/{id}",
"Parameters": {
"path": [
{
@ -258,7 +258,7 @@
"Name": "content/edit",
"Method": "POST",
"Title": "Add/update contents in module section",
"Path": "/{module}/content/{id}",
"Path": "/{moduleID}/content/{id}",
"Parameters": {
"path": [
{
@ -288,7 +288,7 @@
"Name": "content/delete",
"Method": "DELETE",
"Title": "Delete content row from module section",
"Path": "/{module}/content/{id}",
"Path": "/{moduleID}/content/{id}",
"Parameters": {
"path": [
{

View File

@ -137,11 +137,11 @@ func (mh *Module) MountRoutes(r chi.Router, middlewares ...func(http.Handler) ht
r.Get("/{id}", mh.Read)
r.Post("/{id}", mh.Edit)
r.Delete("/{id}", mh.Delete)
r.Get("/{module}/content", mh.ContentList)
r.Post("/{module}/content", mh.ContentCreate)
r.Get("/{module}/content/{id}", mh.ContentRead)
r.Post("/{module}/content/{id}", mh.ContentEdit)
r.Delete("/{module}/content/{id}", mh.ContentDelete)
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)
})
})
}