Skip to content
Snippets Groups Projects
Commit 10caf582 authored by Andrei Cioromila's avatar Andrei Cioromila
Browse files

refactor(invite): use eic extracted method when deleting invitations

parent db28c72f
No related branches found
No related tags found
3 merge requests!160Update staging with master features,!156Develop,!149Hin 1089
...@@ -56,10 +56,9 @@ module.exports = models => async (req, res) => { ...@@ -56,10 +56,9 @@ module.exports = models => async (req, res) => {
user.teams = user.teams.filter(userTeamId => team.id !== userTeamId) user.teams = user.teams.filter(userTeamId => team.id !== userTeamId)
await user.save() await user.save()
notifications.sendNotifications({ notifications.sendInvitedHEEmail({
models, models,
collection, collection,
isEiC: true,
invitedHE: user, invitedHE: user,
isCanceled: true, isCanceled: true,
baseUrl: services.getBaseUrl(req), baseUrl: services.getBaseUrl(req),
......
...@@ -16,12 +16,10 @@ const unsubscribeSlug = config.get('unsubscribe.url') ...@@ -16,12 +16,10 @@ const unsubscribeSlug = config.get('unsubscribe.url')
module.exports = { module.exports = {
sendInvitedHEEmail: async ({ sendInvitedHEEmail: async ({
reason,
baseUrl, baseUrl,
invitedHE, invitedHE,
collection, collection,
isCanceled = false, isCanceled = false,
isAccepted = false,
models: { User: UserModel, Fragment: FragmentModel }, models: { User: UserModel, Fragment: FragmentModel },
}) => { }) => {
const fragmentId = last(collection.fragments) const fragmentId = last(collection.fragments)
...@@ -80,7 +78,6 @@ module.exports = { ...@@ -80,7 +78,6 @@ module.exports = {
baseUrl, baseUrl,
invitedHE, invitedHE,
collection, collection,
isCanceled = false,
isAccepted = false, isAccepted = false,
models: { User: UserModel, Fragment: FragmentModel }, models: { User: UserModel, Fragment: FragmentModel },
}) => { }) => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment