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:
parent
d0bf6e8579
commit
bb223f9f4d
2 changed files with 12 additions and 3 deletions
|
@ -25,6 +25,9 @@
|
|||
"minLength": 0,
|
||||
"maxLength": 2000
|
||||
},
|
||||
"subscribed": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"strip": true
|
||||
},
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue