feat(analytics): initial Habitica-owned solution
This commit is contained in:
committed by
Kalista Payne
parent
746fcfff49
commit
e6ffd69148
@@ -1,4 +1,3 @@
|
||||
import pick from 'lodash/pick';
|
||||
import content from '../content/index';
|
||||
import { beastMasterProgress } from '../count';
|
||||
import i18n from '../i18n';
|
||||
@@ -7,7 +6,7 @@ import {
|
||||
} from '../libs/errors';
|
||||
import updateUserBalance from './updateUserBalance';
|
||||
|
||||
export default function releasePets (user, req = {}, analytics) {
|
||||
export default function releasePets (user, req = {}) {
|
||||
if (user.balance < 1) {
|
||||
throw new NotAuthorized(i18n.t('notEnoughGems', req.language));
|
||||
}
|
||||
@@ -42,17 +41,6 @@ export default function releasePets (user, req = {}, analytics) {
|
||||
user.achievements.beastMasterCount += 1;
|
||||
}
|
||||
|
||||
if (analytics) {
|
||||
analytics.track('release pets', {
|
||||
user: pick(user, ['preferences', 'registeredThrough']),
|
||||
uuid: user._id,
|
||||
currency: 'Gems',
|
||||
gemCost: 4,
|
||||
category: 'behavior',
|
||||
headers: req.headers,
|
||||
});
|
||||
}
|
||||
|
||||
return [
|
||||
user.items.pets,
|
||||
i18n.t('petsReleased'),
|
||||
|
||||
Reference in New Issue
Block a user