Skip to content

Commit 6ceb20c

Browse files
committed
increase activityIndex
1 parent f33927c commit 6ceb20c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/graphql/resolvers/Notification.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* eslint no-param-reassign: 0 */
33

44
import _ from 'lodash';
5+
import Activity from './Activity';
56

67
export default {
78
Query: {
@@ -55,11 +56,16 @@ export default {
5556
return user.notificationSettings;
5657
},
5758

58-
toggleNotification: async (parent, { procedureId }, { user, ProcedureModel }) => {
59+
toggleNotification: async (parent, { procedureId }, { user, ProcedureModel, ActivityModel }) => {
5960
if (!user) {
6061
throw new Error('no Auth');
6162
}
6263
const procedure = await ProcedureModel.findOne({ procedureId });
64+
await Activity.Mutation.increaseActivity(
65+
parent,
66+
{ procedureId },
67+
{ ProcedureModel, ActivityModel, user },
68+
);
6369

6470
const index = user.notificationSettings.procedures.indexOf(procedure._id);
6571
let notify;

0 commit comments

Comments
 (0)