Refactored users module to wrap all methods

no-issue

This also adds initial support for `update` user - which is not used
This commit is contained in:
Fabien O'Carroll 2019-09-24 12:48:56 +07:00
parent f7b61e901d
commit 216ab072b4
2 changed files with 18 additions and 2 deletions

View File

@ -22,6 +22,7 @@ module.exports = function MembersApi({
},
createMember,
getMember,
updateMember,
deleteMember,
listMembers
}) {
@ -47,6 +48,7 @@ module.exports = function MembersApi({
stripe,
createMember,
getMember,
updateMember,
deleteMember,
listMembers
});

View File

@ -2,6 +2,7 @@ module.exports = function ({
stripe,
createMember,
getMember,
updateMember,
listMembers,
deleteMember
}) {
@ -42,9 +43,22 @@ module.exports = function ({
return deleteMember(data, options);
}
async function update(data, options) {
return updateMember(data, options);
}
async function list(data, options) {
return listMembers(data, options);
}
async function create(data, options) {
return createMember(data, options);
}
return {
create: createMember,
list: listMembers,
create,
update,
list,
get,
destroy
};