mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: #10358, bad uploads path
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
|
|
||||||
const db = require('../../database');
|
const db = require('../../database');
|
||||||
@@ -27,7 +29,7 @@ uploadsController.get = async function (req, res, next) {
|
|||||||
|
|
||||||
userData.uploads = uploadNames.map(uploadName => ({
|
userData.uploads = uploadNames.map(uploadName => ({
|
||||||
name: uploadName,
|
name: uploadName,
|
||||||
url: nconf.get('upload_url') + uploadName,
|
url: path.resolve(nconf.get('upload_url'), uploadName),
|
||||||
}));
|
}));
|
||||||
const pageCount = Math.ceil(itemCount / itemsPerPage);
|
const pageCount = Math.ceil(itemCount / itemsPerPage);
|
||||||
userData.pagination = pagination.create(page, pageCount, req.query);
|
userData.pagination = pagination.create(page, pageCount, req.query);
|
||||||
|
|||||||
Reference in New Issue
Block a user