0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Allowed editing subscribed field for members

This commit is contained in:
Nazar Gargol 2019-11-05 18:03:19 +07:00
parent d0bf6e8579
commit bb223f9f4d
2 changed files with 12 additions and 3 deletions

View file

@ -25,6 +25,9 @@
"minLength": 0,
"maxLength": 2000
},
"subscribed": {
"type": "boolean"
},
"id": {
"strip": true
},

View file

@ -75,11 +75,17 @@ async function getMetadata(module, member) {
};
}
async function updateMember({name, note}, options = {}) {
const model = await models.Member.edit({
async function updateMember({name, note, subscribed}, options = {}) {
const attrs = {
name: name || null,
note: note || null
}, options);
};
if (subscribed !== undefined) {
attrs.subscribed = subscribed;
}
const model = await models.Member.edit(attrs, options);
const member = model.toJSON(options);
return member;