Skip to content

Commit

Permalink
Add (/admin)/apps/communities/{community-id}/apps endpoint passthroughs.
Browse files Browse the repository at this point in the history
  • Loading branch information
psarando committed Oct 19, 2018
1 parent 22ab8f5 commit 6296b58
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/terrain/clients/apps/raw.clj
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,20 @@
:as :stream
:follow-redirects false}))

(defn apps-in-community
[community-id]
(client/get (apps-url "apps" "communities" community-id "apps")
{:query-params (secured-params)
:as :stream
:follow-redirects false}))

(defn admin-get-apps-in-community
[community-id]
(client/get (apps-url "admin" "apps" "communities" community-id "apps")
{:query-params (secured-params)
:as :stream
:follow-redirects false}))

(defn search-apps
[params]
(client/get (apps-url "apps")
Expand Down
2 changes: 2 additions & 0 deletions src/terrain/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
(app-avu-routes)
(app-comment-routes)
(app-ontology-routes)
(app-community-routes)
(apps-routes)
(analysis-routes)
(coge-routes)
Expand Down Expand Up @@ -180,6 +181,7 @@
(admin-apps-routes)
(admin-app-avu-routes)
(admin-app-comment-routes)
(admin-app-community-routes)
(admin-comment-routes)
(admin-filesystem-metadata-routes)
(admin-groups-routes)
Expand Down
18 changes: 18 additions & 0 deletions src/terrain/routes/metadata.clj
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,24 @@
(GET "/ontologies/:ontology-version/:root-iri/unclassified" [ontology-version root-iri :as {params :params}]
(service/success-response (apps/get-unclassified-app-listing ontology-version root-iri params)))))

(defn app-community-routes
[]
(optional-routes
[#(and (config/app-routes-enabled)
(config/metadata-routes-enabled))]

(GET "/apps/communities/:community-id/apps" [community-id]
(service/success-response (apps/apps-in-community community-id)))))

(defn admin-app-community-routes
[]
(optional-routes
[#(and (config/app-routes-enabled)
(config/metadata-routes-enabled))]

(GET "/apps/communities/:community-id/apps" [community-id]
(service/success-response (apps/admin-get-apps-in-community community-id)))))

(defn admin-apps-routes
[]
(optional-routes
Expand Down

0 comments on commit 6296b58

Please sign in to comment.