mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-06 19:35:13 +02:00
9 lines
326 B
JavaScript
9 lines
326 B
JavaScript
async function acceptInvitation(token, currentUser) {
|
|||
const invitation = await invitationModel.findByToken(token);
|
|||
if (Date.now() < invitation.expires_at) {
|
|||
return workspaceModel.addMembership(invitation.workspace_id, currentUser.id, invitation.requested_role);
|
|||
}
|
|||
}
|
|||
|
|||
module.exports = { acceptInvitation };
|