Skip to content

Commit

Permalink
Merge pull request #341 from saidone75/dev
Browse files Browse the repository at this point in the history
get-category
  • Loading branch information
saidone75 authored Jul 13, 2024
2 parents 0bf6830 + 94ed97d commit e5bb61a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
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

0 comments on commit e5bb61a

Please sign in to comment.