Last active
July 13, 2016 02:59
-
-
Save wallacyyy/8509e98cd5011a859b3b35336d9c3023 to your computer and use it in GitHub Desktop.
2016-07-11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Invite = require('./invite') | |
module.exports = { | |
pending: function () { | |
return Invite.findAll({ | |
where: { | |
confirmed: false | |
} | |
}) | |
}, | |
create: function (attrs) { | |
return Invite.create(attrs) | |
}, | |
confirm: function (url) { | |
const params = { | |
confirmed: true | |
} | |
const options = { | |
returning: true, | |
raw: true, | |
where: { | |
url: url | |
} | |
} | |
return Invite.update(params, options) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment