mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
* feat: move all user profile pics to folder
get rid of glob delete and just delete the uid-{uid} folder when deleting user images
* when exporting user uploads add all profile uploads
* uid check
This commit is contained in:
committed by
GitHub
parent
aef3ea18cf
commit
8f9ac5c17a
@@ -18,8 +18,7 @@ const plugins = require('../plugins');
|
||||
const events = require('../events');
|
||||
const translator = require('../translator');
|
||||
const sockets = require('../socket.io');
|
||||
|
||||
// const api = require('.');
|
||||
const utils = require('../utils');
|
||||
|
||||
const usersAPI = module.exports;
|
||||
|
||||
@@ -686,6 +685,9 @@ usersAPI.generateExport = async (caller, { uid, type }) => {
|
||||
if (!validTypes.includes(type)) {
|
||||
throw new Error('[[error:invalid-data]]');
|
||||
}
|
||||
if (!utils.isNumber(uid) || !(parseInt(uid, 10) > 0)) {
|
||||
throw new Error('[[error:invalid-uid]]');
|
||||
}
|
||||
const count = await db.incrObjectField('locks', `export:${uid}${type}`);
|
||||
if (count > 1) {
|
||||
throw new Error('[[error:already-exporting]]');
|
||||
|
||||
Reference in New Issue
Block a user