mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
Merge branch 'master' of https://github.com/NodeBB/NodeBB
This commit is contained in:
@@ -88,11 +88,11 @@
|
||||
"nodebb-plugin-2factor": "3.0.4",
|
||||
"nodebb-plugin-composer-default": "7.0.20",
|
||||
"nodebb-plugin-dbsearch": "5.1.1",
|
||||
"nodebb-plugin-emoji": "3.5.11",
|
||||
"nodebb-plugin-emoji": "3.5.12",
|
||||
"nodebb-plugin-emoji-android": "2.0.5",
|
||||
"nodebb-plugin-markdown": "9.0.5",
|
||||
"nodebb-plugin-markdown": "9.0.6",
|
||||
"nodebb-plugin-mentions": "3.0.4",
|
||||
"nodebb-plugin-spam-be-gone": "0.7.12",
|
||||
"nodebb-plugin-spam-be-gone": "0.7.13",
|
||||
"nodebb-rewards-essentials": "0.2.1",
|
||||
"nodebb-theme-lavender": "5.3.2",
|
||||
"nodebb-theme-persona": "11.3.38",
|
||||
@@ -109,7 +109,6 @@
|
||||
"postcss": "8.4.6",
|
||||
"postcss-clean": "1.2.0",
|
||||
"prompt": "1.2.1",
|
||||
"punycode": "2.1.1",
|
||||
"ioredis": "4.28.5",
|
||||
"request": "2.88.2",
|
||||
"request-promise-native": "1.0.9",
|
||||
@@ -185,4 +184,4 @@
|
||||
"url": "https://github.com/barisusakli"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
const _ = require('lodash');
|
||||
const validator = require('validator');
|
||||
const winston = require('winston');
|
||||
const punycode = require('punycode');
|
||||
|
||||
const utils = require('../utils');
|
||||
const slugify = require('../slugify');
|
||||
@@ -46,28 +45,14 @@ module.exports = function (User) {
|
||||
|
||||
data[field] = data[field].trim();
|
||||
|
||||
switch (field) {
|
||||
case 'email': {
|
||||
return await updateEmail(updateUid, data.email);
|
||||
}
|
||||
|
||||
case 'username': {
|
||||
return await updateUsername(updateUid, data.username);
|
||||
}
|
||||
|
||||
case 'fullname': {
|
||||
return await updateFullname(updateUid, data.fullname);
|
||||
}
|
||||
|
||||
case 'website': {
|
||||
updateData[field] = punycode.toASCII(data[field]);
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
updateData[field] = data[field];
|
||||
}
|
||||
if (field === 'email') {
|
||||
return await updateEmail(updateUid, data.email);
|
||||
} else if (field === 'username') {
|
||||
return await updateUsername(updateUid, data.username);
|
||||
} else if (field === 'fullname') {
|
||||
return await updateFullname(updateUid, data.fullname);
|
||||
}
|
||||
updateData[field] = data[field];
|
||||
}));
|
||||
|
||||
if (Object.keys(updateData).length) {
|
||||
|
||||
Reference in New Issue
Block a user