mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 17:46:16 +01:00
fix: tests
This commit is contained in:
@@ -7,7 +7,7 @@ const topics = require('../../topics');
|
||||
const privileges = require('../../privileges');
|
||||
|
||||
const helpers = require('../helpers');
|
||||
const middleware = require('../../middleware/assert');
|
||||
const middleware = require('../../middleware');
|
||||
const uploadsController = require('../uploads');
|
||||
|
||||
const Topics = module.exports;
|
||||
@@ -130,7 +130,7 @@ Topics.migrateThumbs = async (req, res) => {
|
||||
|
||||
Topics.deleteThumb = async (req, res) => {
|
||||
if (!req.body.path.startsWith('http')) {
|
||||
await middleware.assert.path(req, res);
|
||||
await middleware.assert.path(req, res, function () {});
|
||||
if (res.headersSent) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
var _ = require('lodash');
|
||||
const validator = require('validator');
|
||||
const path = require('path');
|
||||
|
||||
var db = require('../database');
|
||||
var posts = require('../posts');
|
||||
@@ -172,6 +173,8 @@ Topics.getTopicWithPosts = async function (topicData, set, uid, start, stop, rev
|
||||
// Note: Backwards compatibility with old thumb logic, remove in v1.16.0
|
||||
if (topicData.thumb && !topicData.thumbs.length) {
|
||||
topicData.thumbs = [{
|
||||
id: topicData.tid,
|
||||
name: path.basename(topicData.thumb),
|
||||
url: topicData.thumb,
|
||||
}];
|
||||
} else if (topicData.thumbs.length) {
|
||||
|
||||
Reference in New Issue
Block a user