isekai-main
Barış Soner Uşaklı 3 years ago
commit e5688d2c0d

@ -88,11 +88,11 @@
"nodebb-plugin-2factor": "3.0.4", "nodebb-plugin-2factor": "3.0.4",
"nodebb-plugin-composer-default": "7.0.20", "nodebb-plugin-composer-default": "7.0.20",
"nodebb-plugin-dbsearch": "5.1.1", "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-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-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-rewards-essentials": "0.2.1",
"nodebb-theme-lavender": "5.3.2", "nodebb-theme-lavender": "5.3.2",
"nodebb-theme-persona": "11.3.38", "nodebb-theme-persona": "11.3.38",
@ -109,7 +109,6 @@
"postcss": "8.4.6", "postcss": "8.4.6",
"postcss-clean": "1.2.0", "postcss-clean": "1.2.0",
"prompt": "1.2.1", "prompt": "1.2.1",
"punycode": "2.1.1",
"ioredis": "4.28.5", "ioredis": "4.28.5",
"request": "2.88.2", "request": "2.88.2",
"request-promise-native": "1.0.9", "request-promise-native": "1.0.9",
@ -185,4 +184,4 @@
"url": "https://github.com/barisusakli" "url": "https://github.com/barisusakli"
} }
] ]
} }

@ -4,7 +4,6 @@
const _ = require('lodash'); const _ = require('lodash');
const validator = require('validator'); const validator = require('validator');
const winston = require('winston'); const winston = require('winston');
const punycode = require('punycode');
const utils = require('../utils'); const utils = require('../utils');
const slugify = require('../slugify'); const slugify = require('../slugify');
@ -46,28 +45,14 @@ module.exports = function (User) {
data[field] = data[field].trim(); data[field] = data[field].trim();
switch (field) { if (field === 'email') {
case 'email': { return await updateEmail(updateUid, data.email);
return await updateEmail(updateUid, data.email); } else if (field === 'username') {
} return await updateUsername(updateUid, data.username);
} else if (field === 'fullname') {
case 'username': { return await updateFullname(updateUid, data.fullname);
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];
}
} }
updateData[field] = data[field];
})); }));
if (Object.keys(updateData).length) { if (Object.keys(updateData).length) {

Loading…
Cancel
Save