mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Reduce size of client js bundles (#15264)
* add packages * Only include the needed parts of BootstrapVue * remove yargs from client * treeshake validator library * formatting * fix import
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import validator from 'validator';
|
||||
import isUUID from 'validator/lib/isUUID';
|
||||
import i18n from '../i18n';
|
||||
import {
|
||||
BadRequest,
|
||||
} from '../libs/errors';
|
||||
|
||||
export default function blockUser (user, req = {}) {
|
||||
if (!validator.isUUID(req.params.uuid)) throw new BadRequest(i18n.t('invalidUUID', req.language));
|
||||
if (!isUUID(req.params.uuid)) throw new BadRequest(i18n.t('invalidUUID', req.language));
|
||||
if (req.params.uuid === user._id) throw new BadRequest(i18n.t('blockYourself', req.language));
|
||||
|
||||
const i = user.inbox.blocks.indexOf(req.params.uuid);
|
||||
|
||||
Reference in New Issue
Block a user