From b079f32e7d92c958deb9464a4b7ed53abfb51361 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Fri, 28 Jan 2022 15:05:30 -0800 Subject: [PATCH] preparing article block endpoints --- doc/api.oa3 | 4 ++-- net/server/internal/api_content.go | 5 ----- net/server/internal/api_getArticleBlocks.go | 11 +++++++++++ net/server/internal/notify.go | 4 ++-- net/server/internal/routers.go | 6 +++--- 5 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 net/server/internal/api_getArticleBlocks.go diff --git a/doc/api.oa3 b/doc/api.oa3 index ad38a57e..7e4705b7 100644 --- a/doc/api.oa3 +++ b/doc/api.oa3 @@ -1543,11 +1543,11 @@ paths: type: integer format: int64 - /content/articleBlocks/view: + /content/articleBlocks: get: tags: - content - description: Get article block views. Acess granted to account token or contact token. When the request is made with a contact token the account view revision will be added to the block revision. + description: Get article blocks that should be updated based on revisions. Acess granted to account token or contact token. When the request is made with a contact token the account view revision will be added to the block revision. operationId: get-article-block-view security: - bearerAuth: [] diff --git a/net/server/internal/api_content.go b/net/server/internal/api_content.go index 21c516f8..7c5ed99d 100644 --- a/net/server/internal/api_content.go +++ b/net/server/internal/api_content.go @@ -58,11 +58,6 @@ func GetArticleAssets(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } -func GetArticleBlockView(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - w.WriteHeader(http.StatusOK) -} - func GetArticleSubjectField(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) diff --git a/net/server/internal/api_getArticleBlocks.go b/net/server/internal/api_getArticleBlocks.go new file mode 100644 index 00000000..37ad0562 --- /dev/null +++ b/net/server/internal/api_getArticleBlocks.go @@ -0,0 +1,11 @@ +package databag + +import ( + "net/http" +) + +func GetArticleBlocks(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) +} + diff --git a/net/server/internal/notify.go b/net/server/internal/notify.go index c2881551..2dee2e9d 100644 --- a/net/server/internal/notify.go +++ b/net/server/internal/notify.go @@ -109,7 +109,7 @@ func SetProfileNotification(account *store.Account) { } // notify all cards of content change -// account.Content incremented by adding, updating, removing article +// account.Content incremented by adding, updating, removing article & setting or clearning group or label from article func SetContentNotification(account *store.Account) { // select all connected cards @@ -165,7 +165,7 @@ func SetContactContentNotification(account *store.Account, card *store.Card) { // notify all cards of view change -// account.View incremented by removing a group or label or adding or removing a group with label +// account.View incremented by removing a group or label or adding or removing a group from a label func SetViewNotification(account *store.Account) { // select all connected cards diff --git a/net/server/internal/routers.go b/net/server/internal/routers.go index 21fc35e4..788a5992 100644 --- a/net/server/internal/routers.go +++ b/net/server/internal/routers.go @@ -482,10 +482,10 @@ var routes = Routes{ }, Route{ - "GetArticleBlockView", + "GetArticleBlocks", strings.ToUpper("Get"), - "/content/articleBlocks/view", - GetArticleBlockView, + "/content/articleBlocks", + GetArticleBlocks, }, Route{