Merge branch 'master' into dev
This commit is contained in:
@@ -570,8 +570,8 @@ const eventController = {
|
||||
let tags = []
|
||||
if (body.tags) {
|
||||
tags = await tagController._findOrCreate(body.tags)
|
||||
await event.setTags(tags)
|
||||
}
|
||||
await event.setTags(tags)
|
||||
|
||||
let newEvent = await Event.findByPk(event.id, { include: [Tag, Place] })
|
||||
newEvent = newEvent.get()
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
const Sequelize = require('sequelize')
|
||||
|
||||
// this is an hack: https://github.com/sequelize/sequelize/pull/14800
|
||||
const livePatchMariaDBDialect = require('sequelize/lib/dialects/mariadb/query')
|
||||
livePatchMariaDBDialect.prototype.handleJsonSelectQuery = () => null
|
||||
|
||||
const Umzug = require('umzug')
|
||||
const path = require('path')
|
||||
const config = require('../../config')
|
||||
|
||||
@@ -108,8 +108,12 @@ module.exports = {
|
||||
const router = express.Router()
|
||||
// serve images/thumb
|
||||
router.use('/media/', express.static(config.upload_path, { immutable: true, maxAge: '1y' }), (_req, res) => res.sendStatus(404))
|
||||
router.use('/download/:filename', (req, res, next) => {
|
||||
return res.download(req.params.filename, undefined, { root: config.upload_path }, err => res.status(404).send('Not found (but nice try 😊)'))
|
||||
router.use('/download/:filename', (req, res) => {
|
||||
return res.download(req.params.filename, undefined, { root: config.upload_path }, err => {
|
||||
if (err) {
|
||||
res.status(404).send('Not found (but nice try 😊)')
|
||||
}
|
||||
})
|
||||
})
|
||||
router.use('/noimg.svg', express.static('./static/noimg.svg'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user