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

get-category #341

Merged
merged 1 commit into from
Jul 13, 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
14 changes: 14 additions & 0 deletions src/cral/api/core/categories.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
(:import (clojure.lang PersistentHashMap PersistentVector)
(cral.model.auth Ticket)
(cral.model.core CreateCategoryQueryParams
GetCategoryQueryParams
ListCategoriesQueryParams
ListNodeCategoriesQueryParams)))

Expand Down Expand Up @@ -81,6 +82,19 @@
nil
opts))

(defn get-category
"Get a specific category with `category-id`.\\
More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API)."
([^Ticket ticket ^String category-id]
(get-gategory ticket category-id nil))
([^Ticket ticket ^String category-id ^GetCategoryQueryParams query-params & [^PersistentHashMap opts]]
(utils/call-rest
client/get
(format "%s/categories/%s" (config/get-url 'core) category-id)
ticket
{:query-params query-params}
opts)))

(defn delete-category
"Deletes the category with `category-id`. This will cause everything to be removed from the category.
You must have admin rights to delete a category.\\
Expand Down
4 changes: 4 additions & 0 deletions src/cral/model/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,10 @@
^PersistentVector include
^PersistentVector fields])

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

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