mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +03:00
Fixed generation of api urls for members service (#10869)
no-issue Previously we used urlFor which wasn't setup to correctly support members. This changes members service to use the admin URL directly
This commit is contained in:
parent
1225bd2fe9
commit
683e37c764
@ -116,8 +116,16 @@ const siteOrigin = doBlock(() => {
|
||||
return `${protocol}//${host}`;
|
||||
});
|
||||
|
||||
const contentApiUrl = urlUtils.urlFor('api', {version: 'v2', type: 'content'}, true);
|
||||
const membersApiUrl = urlUtils.urlFor('api', {version: 'v2', type: 'members'}, true);
|
||||
const getApiUrl = ({version, type}) => {
|
||||
const {href} = new url.URL(
|
||||
urlUtils.getApiPath({version, type}),
|
||||
urlUtils.urlFor('admin', true)
|
||||
);
|
||||
return href;
|
||||
};
|
||||
|
||||
const contentApiUrl = getApiUrl({version: 'v2', type: 'content'});
|
||||
const membersApiUrl = getApiUrl({version: 'v2', type: 'members'});
|
||||
|
||||
const accessControl = {
|
||||
[siteOrigin]: {
|
||||
|
Loading…
Reference in New Issue
Block a user