diff --git a/apps/web/src/components/policies/index.jsx b/apps/web/src/components/policies/index.jsx index acba748..3f13d56 100644 --- a/apps/web/src/components/policies/index.jsx +++ b/apps/web/src/components/policies/index.jsx @@ -26,7 +26,7 @@ export default () => { const savePolicy = (p) => (e) => { e.preventDefault() e.stopPropagation() - client.post(endpoints.policies()).then(data => { + client.post(endpoints.policy(p.id || '_new')).then(data => { if (data.error) { return setError(data.error) } @@ -36,7 +36,7 @@ export default () => { const deletePolicy = (name) => (e) => { e.preventDefault() e.stopPropagation() - client.del(endpoints.policies()).then(data => { + client.del(endpoints.policy(p.id)).then(data => { if (data.error) { return setError(data.error) } diff --git a/apps/web/src/lib/moonbase/endpoints.js b/apps/web/src/lib/moonbase/endpoints.js index dcd8908..87d6171 100644 --- a/apps/web/src/lib/moonbase/endpoints.js +++ b/apps/web/src/lib/moonbase/endpoints.js @@ -18,7 +18,8 @@ export const endpoints = { reference: (owner, repo, branch, collection, id, locale) => (`/cms/${owner}/${repo}/${branch}/reference/${collection}/${id}/${locale}`), - policies: () => (`/auth/policies`), + policies: () => (`/system/policies`), + policy: (id) => (`/system/policies/${id}`), } export const defaultLocale = "en"