mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Fix 500 errors coming from Google scripts (#15237)
* fix issue with userFields options * remove only --------- Co-authored-by: Phillip Thelen <phillip@habitica.com>
This commit is contained in:
@@ -36,9 +36,11 @@ function getUserFields (options, req) {
|
||||
const { userFields } = req.query;
|
||||
if (!userFields || urlPath !== '/user') return '';
|
||||
|
||||
const userFieldOptions = userFields.split(',');
|
||||
let userFieldOptions = userFields.split(',');
|
||||
if (userFieldOptions.length === 0) return '';
|
||||
|
||||
userFieldOptions = userFieldOptions.filter(field => USER_FIELDS_ALWAYS_LOADED.indexOf(field.split('.')[0]) === -1);
|
||||
|
||||
return userFieldOptions.concat(USER_FIELDS_ALWAYS_LOADED).join(' ');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user