Bug fix and verb standardization

This commit is contained in:
2026-07-09 21:13:14 -05:00
parent 0417497457
commit 1d0cd04322
7 changed files with 65 additions and 67 deletions

View File

@@ -11,7 +11,7 @@ const getThemes = async (_req, res) => {
conn.end();
};
const addTheme = async (req, res) => {
const createTheme = async (req, res) => {
const conn = await pool.getConnection();
const query = `INSERT INTO trigger_database.themes (name, backgroundImage, backgroundColor, searchColor, primaryColor, accentColor, borderColor, themeFont) VALUES (${escapeString(req.body.name)},${escapeString(req.body.backgroundImage)},${escapeString(req.body.backgroundColor)},${escapeString(req.body.searchColor)},${escapeString(req.body.primaryColor)},${escapeString(req.body.accentColor)},${escapeString(req.body.borderColor)},${escapeString(req.body.themeFont)})`;
conn
@@ -62,7 +62,7 @@ const getThemePlaylists = async (_req, res) => {
conn.end();
};
const addThemePlaylist = async (req, res) => {
const createThemePlaylist = async (req, res) => {
const conn = await pool.getConnection();
const query = `INSERT INTO trigger_database.themePlaylists (name, themeList) VALUES (${escapeString(req.body.name)},${escapeString(req.body.themeList)});`;
conn
@@ -111,12 +111,12 @@ const getBackgrounds = async (_req, res) => {
(_err, files) => {
res
.status(200)
.send(files.filter((file) => file.isFile()).map((file) => file.name));
.send(files?.filter((file) => file.isFile()).map((file) => file.name));
},
);
};
const uploadBackground = async (req, res) => {
const addBackground = async (req, res) => {
const image = req.file.path;
const thumbnail = `${req.file.destination}thumbs/${req.file.filename}`;
exec(`convert ${image} -resize 'x1080' -define jpeg:extent=300kb ${image}`);
@@ -177,15 +177,15 @@ const deleteBackground = async (req, res) => {
module.exports = {
getThemes,
addTheme,
createTheme,
updateTheme,
deleteTheme,
getThemePlaylists,
addThemePlaylist,
createThemePlaylist,
updateThemePlaylist,
deleteThemePlaylist,
getBackgrounds,
uploadBackground,
addBackground,
updateBackground,
deleteBackground,
};