mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Merge branch 'api-v3' into api-v3-client
This commit is contained in:
@@ -44,9 +44,11 @@ module.exports = function unlock (user, req = {}, analytics) {
|
||||
|
||||
if (alreadyOwnedItems === setPaths.length) {
|
||||
throw new NotAuthorized(i18n.t('alreadyUnlocked', req.language));
|
||||
} else if (alreadyOwnedItems > 0) {
|
||||
// TODO write math formula to check if buying the full set is cheaper than the items individually
|
||||
// (item cost * number of remaining items) < setCost`
|
||||
} /* else if (alreadyOwnedItems > 0) {
|
||||
throw new NotAuthorized(i18n.t('alreadyUnlockedPart', req.language));
|
||||
}
|
||||
} */
|
||||
} else {
|
||||
alreadyOwns = _.get(user, `purchased.${path}`) === true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user