diff --git a/ghost/portal/src/utils/api.js b/ghost/portal/src/utils/api.js index 3cc8fbac44..2a963fc79c 100644 --- a/ghost/portal/src/utils/api.js +++ b/ghost/portal/src/utils/api.js @@ -67,6 +67,28 @@ function setupGhostApi() { }); }, + update({email, name, subscribed}) { + const url = endpointFor({type: 'members', resource: 'member'}); + return makeRequest({ + url, + method: 'PUT', + headers: { + 'Content-Type': 'application/json' + }, + credentials: 'same-origin', + body: JSON.stringify({ + email, + name, + subscribed + }) + }).then(function (res) { + if (!res.ok) { + return null; + } + return res.json(); + }); + }, + sendMagicLink({email, emailType, labels}) { const url = endpointFor({type: 'members', resource: 'send-magic-link'}); return makeRequest({