Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Commit

Permalink
Add tracking and failure tracking for the rest of the things
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlovin committed May 11, 2018
1 parent 7b9d7f3 commit c1587f3
Show file tree
Hide file tree
Showing 61 changed files with 1,512 additions and 242 deletions.
16 changes: 11 additions & 5 deletions api/models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ const editUser = (args: EditUserInput, userId: string): Promise<DBUser> => {
event: events.USER_EDITED,
});

identifyQueue.add({ userId: user.id });

return result.changes[0].new_val;
}

Expand Down Expand Up @@ -350,6 +352,9 @@ const editUser = (args: EditUserInput, userId: string): Promise<DBUser> => {
userId,
event: events.USER_EDITED,
});

identifyQueue.add({ userId: user.id });

return result.changes[0].new_val;
}

Expand All @@ -362,6 +367,7 @@ const editUser = (args: EditUserInput, userId: string): Promise<DBUser> => {
reason: 'no changes',
},
});

return result.changes[0].old_val;
}
})
Expand Down Expand Up @@ -409,6 +415,8 @@ const editUser = (args: EditUserInput, userId: string): Promise<DBUser> => {
event: events.USER_EDITED,
});

identifyQueue.add({ userId: user.id });

return result.changes[0].new_val;
}

Expand Down Expand Up @@ -446,6 +454,9 @@ const editUser = (args: EditUserInput, userId: string): Promise<DBUser> => {
userId,
event: events.USER_EDITED,
});

identifyQueue.add({ userId: user.id });

return result.changes[0].new_val;
}

Expand Down Expand Up @@ -482,7 +493,6 @@ const setUserOnline = (id: string, isOnline: boolean): DBUser => {
.then(result => {
if (result.changes[0].new_val) {
const user = result.changes[0].new_val;
identifyQueue.add({ userId: user.id });
return user;
}
return result.changes[0].old_val;
Expand All @@ -505,8 +515,6 @@ const setUserPendingEmail = (userId: string, pendingEmail: string): Promise<Obje
event: events.USER_ADDED_EMAIL,
});

identifyQueue.add({ userId: user.id });

return user
});
};
Expand All @@ -526,8 +534,6 @@ const updateUserEmail = (userId: string, email: string): Promise<Object> => {
userId: user.id,
event: events.USER_VERIFIED_EMAIL,
});

identifyQueue.add({ userId: user.id });
});
};

Expand Down
Loading

0 comments on commit c1587f3

Please sign in to comment.