Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update-category #343

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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