Phase 1: Add ESLint/Prettier config + baseline auto-fixes
This commit is contained in:
@@ -46,15 +46,15 @@ module.exports = function(ctx) {
|
||||
|
||||
const themeData = { name, ...colors };
|
||||
if (lightBg) themeData.lightBg = true;
|
||||
fs.writeFileSync(path.join(THEMES_DIR, slug + '.json'), JSON.stringify(themeData, null, 2), 'utf8');
|
||||
fs.writeFileSync(path.join(THEMES_DIR, `${slug }.json`), JSON.stringify(themeData, null, 2), 'utf8');
|
||||
|
||||
res.json({ success: true, message: name + ' theme saved' });
|
||||
res.json({ success: true, message: `${name } theme saved` });
|
||||
});
|
||||
|
||||
// Delete a theme
|
||||
router.delete('/themes/:slug', (req, res) => {
|
||||
const { slug } = req.params;
|
||||
const filePath = path.join(THEMES_DIR, slug + '.json');
|
||||
const filePath = path.join(THEMES_DIR, `${slug }.json`);
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return res.status(404).json({ success: false, error: 'Theme not found' });
|
||||
@@ -64,7 +64,7 @@ module.exports = function(ctx) {
|
||||
const name = data.name || slug;
|
||||
fs.unlinkSync(filePath);
|
||||
|
||||
res.json({ success: true, message: name + ' theme deleted' });
|
||||
res.json({ success: true, message: `${name } theme deleted` });
|
||||
});
|
||||
|
||||
return router;
|
||||
|
||||
Reference in New Issue
Block a user