Skip to content

Commit

Permalink
add quest complete event
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcasey committed Dec 5, 2024
1 parent 89c1217 commit 8610e33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/mixpanel/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export type MixpanelEventMap = {
referralCode: string;
referrerPath: string;
};
complete_quest: BaseEvent & {
questType: string;
};
} & Record<EventType, FrontendEvent>;

export type MixpanelEvent = MixpanelEventMap[keyof MixpanelEventMap];
Expand Down
3 changes: 3 additions & 0 deletions packages/scoutgame/src/quests/completeQuest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { prisma } from '@charmverse/core/prisma-client';
import { trackUserAction } from '@packages/mixpanel/trackUserAction';
import { QuestsRecord } from '@packages/scoutgame-ui/components/quests/QuestsList/QuestsRecord';

import { sendPointsForSocialQuest } from '../points/builderEvents/sendPointsForSocialQuest';
Expand All @@ -21,4 +22,6 @@ export async function completeQuest(userId: string, questType: string) {
points,
type: questType
});

trackUserAction('complete_quest', { userId, questType });
}

0 comments on commit 8610e33

Please sign in to comment.