Public Access
Visitor sign in kiosk: multi-site, badge printing, WWCC expiry warnings, admin accounts with 2FA
This commit is contained in:
+7
-2
@@ -14,6 +14,7 @@ import {
|
||||
DEFAULT_THEME,
|
||||
bannerAbsolutePath,
|
||||
deleteBanner,
|
||||
normaliseAlign,
|
||||
normaliseColour,
|
||||
saveBanner,
|
||||
} from '../branding.js';
|
||||
@@ -387,7 +388,8 @@ router.patch('/sites/:id', (req, res) => {
|
||||
db.prepare(
|
||||
`UPDATE sites SET name = ?, slug = ?, active = ?, badge_enabled = ?, badge_width_mm = ?,
|
||||
badge_height_mm = ?, badge_show_photo = ?, badge_accent = ?, badge_note = ?,
|
||||
colour_brand = ?, colour_signout = ?, colour_page = ?, banner_height = ? WHERE id = ?`
|
||||
colour_brand = ?, colour_signout = ?, colour_page = ?, banner_height = ?,
|
||||
banner_align = ? WHERE id = ?`
|
||||
).run(
|
||||
clean(req.body?.name ?? site.name, 100) || site.name,
|
||||
req.body?.slug ? uniqueSlug(req.body.slug, site.id) : site.slug,
|
||||
@@ -409,7 +411,10 @@ router.patch('/sites/:id', (req, res) => {
|
||||
branding.page !== undefined ? normaliseColour(branding.page, null) : site.colour_page,
|
||||
branding.bannerHeight !== undefined
|
||||
? Math.min(200, Math.max(24, Number(branding.bannerHeight) || 64))
|
||||
: site.banner_height
|
||||
: site.banner_height,
|
||||
branding.bannerAlign !== undefined
|
||||
? normaliseAlign(branding.bannerAlign, site.banner_align)
|
||||
: site.banner_align
|
||||
, site.id);
|
||||
|
||||
res.json(shapeSite(db.prepare('SELECT * FROM sites WHERE id = ?').get(site.id)));
|
||||
|
||||
Reference in New Issue
Block a user