feat: add isACP to config, closes #12623

This commit is contained in:
Barış Soner Uşaklı
2024-06-08 12:30:26 -04:00
parent 1b283ccc29
commit c51b772fae
2 changed files with 4 additions and 0 deletions

View File

@@ -94,6 +94,9 @@ get:
uid:
type: number
description: A user identifier
isACP:
type: boolean
description: true if admin page is being loaded, false otherwise
cache-buster:
type: string
topicPostSort:

View File

@@ -67,6 +67,7 @@ apiController.loadConfig = async function (req) {
userLang: req.query.lang ? validator.escape(String(req.query.lang)) : (meta.config.defaultLang || 'en-GB'),
loggedIn: !!req.user,
uid: req.uid,
isACP: !!(req.res && req.res.locals && req.res.locals.renderAdminHeader),
'cache-buster': meta.config['cache-buster'] || '',
topicPostSort: meta.config.topicPostSort || 'oldest_to_newest',
categoryTopicSort: meta.config.categoryTopicSort || 'recently_replied',