Rebrand site for podcast, add admin CMS, social metadata, and platform links
This commit is contained in:
@@ -25,17 +25,17 @@ app.get('/api/admin-content', async (_req, res) => {
|
||||
|
||||
app.put('/api/admin-content', async (req, res) => {
|
||||
try {
|
||||
const { projects, siteContent } = req.body ?? {}
|
||||
const { siteContent } = req.body ?? {}
|
||||
|
||||
if (!Array.isArray(projects) || !siteContent || typeof siteContent !== 'object') {
|
||||
res.status(400).json({ message: 'Invalid payload.' })
|
||||
if (!siteContent || typeof siteContent !== 'object' || Array.isArray(siteContent)) {
|
||||
res.status(400).json({ message: 'Invalid payload: siteContent must be an object.' })
|
||||
return
|
||||
}
|
||||
|
||||
await mkdir(DATA_DIR, { recursive: true })
|
||||
await writeFile(
|
||||
DATA_FILE,
|
||||
JSON.stringify({ projects, siteContent, updatedAt: new Date().toISOString() }, null, 2),
|
||||
JSON.stringify({ siteContent, updatedAt: new Date().toISOString() }, null, 2),
|
||||
'utf8',
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user