Another batch of important updates and fixes

This commit is contained in:
Luka Romih
2026-02-23 15:29:58 +01:00
parent d0e53fee3b
commit fd02e25719
40 changed files with 216 additions and 71 deletions
+9
View File
@@ -1,4 +1,5 @@
const { getInstanceSetting } = require('../models/helpers')
const Entry = require('../models/entry')
exports.enhanceLocals = async (req, res, next) => {
res.locals.portalCode = await getInstanceSetting('portal_code')
@@ -12,3 +13,11 @@ exports.adjustHeaders = async (req, res, next) => {
next()
}
exports.setDerivedDictionaryIdFromEntryId = async (req, res, next) => {
const { entryId } = req.query
const { dictionary_id: dictionaryId } = await Entry.fetch(entryId)
req.derivedDictionaryId = dictionaryId
next()
}