Skip to content

Instantly share code, notes, and snippets.

@wallacyyy
Last active July 13, 2016 02:59
Show Gist options
  • Save wallacyyy/8509e98cd5011a859b3b35336d9c3023 to your computer and use it in GitHub Desktop.
Save wallacyyy/8509e98cd5011a859b3b35336d9c3023 to your computer and use it in GitHub Desktop.
2016-07-11
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