Skip to content

Commit

Permalink
Merge pull request #343 from saidone75/dev
Browse files Browse the repository at this point in the history
update-category
  • Loading branch information
saidone75 authored Jul 15, 2024
2 parents f82ff15 + 725a3ae commit 0c81041
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/cral/api/core/categories.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
(cral.model.core CreateCategoryQueryParams
GetCategoryQueryParams
ListCategoriesQueryParams
ListNodeCategoriesQueryParams)))
ListNodeCategoriesQueryParams
UpdateCategoryBody
UpdateCategoryQueryParams)))

(defn list-node-categories
"Gets a list of categories for node `node-id`.\\
Expand Down Expand Up @@ -107,6 +109,22 @@
nil
opts))

(defn update-category
"Updates the category `category-id`.
You must have admin rights to update a category.\\
More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API)."
([^Ticket ticket ^String category-id ^UpdateCategoryBody body]
(update-category ticket category-id body nil))
([^Ticket ticket ^String category-id ^UpdateCategoryBody body ^UpdateCategoryQueryParams query-params & [^PersistentHashMap opts]]
(utils/call-rest
client/post
(format "%s/categories/%s" (config/get-url 'core) category-id)
ticket
{:body (json/write-str (utils/camel-case-stringify-keys body))
:query-params query-params
:content-type :json}
opts)))

(defn list-categories
"Gets a list of subcategories within the category `category-id`.
The parameter `category-id` can be set to the alias -root- to obtain a list of top level categories.\\
Expand Down
7 changes: 7 additions & 0 deletions src/cral/model/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,13 @@
[^PersistentVector include
^PersistentVector fields])

(defrecord UpdateCategoryBody
[^String name])

(defrecord UpdateCategoryQueryParams
[^PersistentVector include
^PersistentVector fields])

(defrecord ListCategoriesQueryParams
[^PersistentVector include
^Integer skip-count
Expand Down

0 comments on commit 0c81041

Please sign in to comment.