mirror of
https://github.com/penpot/penpot.git
synced 2026-10-29 05:50:35 +00:00
🐛 Preserve team ID in Nitrate membership URL (#12157)
This commit is contained in:
parent
edd500302c
commit
65b248eec3
@ -275,7 +275,7 @@
|
||||
(request-to-nitrate cfg :get
|
||||
(generate-nitrate-uri
|
||||
"api/teams/"
|
||||
team-id
|
||||
(str team-id "/")
|
||||
"users/"
|
||||
profile-id)
|
||||
schema:profile-organization params))
|
||||
|
||||
34
backend/test/backend_tests/nitrate_test.clj
Normal file
34
backend/test/backend_tests/nitrate_test.clj
Normal file
@ -0,0 +1,34 @@
|
||||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS SUBSIDIARY SL
|
||||
|
||||
(ns backend-tests.nitrate-test
|
||||
(:require
|
||||
[app.config :as cf]
|
||||
[app.nitrate]
|
||||
[clojure.test :as t]))
|
||||
|
||||
(def ^:private generate-nitrate-uri
|
||||
(ns-resolve 'app.nitrate 'generate-nitrate-uri))
|
||||
|
||||
(t/deftest generate-nitrate-uri-test
|
||||
(binding [cf/config (assoc cf/config
|
||||
:admin-console-uri
|
||||
"http://ac.example/admin-console")]
|
||||
(doseq [[label segments expected]
|
||||
[["single segment"
|
||||
["api/connectivity"]
|
||||
"http://ac.example/admin-console/api/connectivity"]
|
||||
["resource identifier as the final segment"
|
||||
["api/teams/" "team-id"]
|
||||
"http://ac.example/admin-console/api/teams/team-id"]
|
||||
["nested team membership path"
|
||||
["api/teams/" "team-id/" "users/" "profile-id"]
|
||||
"http://ac.example/admin-console/api/teams/team-id/users/profile-id"]
|
||||
["nested organization membership path"
|
||||
["api/organizations/" "organization-id/" "members/" "profile-id"]
|
||||
"http://ac.example/admin-console/api/organizations/organization-id/members/profile-id"]]]
|
||||
(t/testing label
|
||||
(t/is (= expected (apply generate-nitrate-uri segments)))))))
|
||||
Loading…
x
Reference in New Issue
Block a user