Refactor web server and release workflow
This commit is contained in:
@@ -106,9 +106,12 @@ async function buildTemplatePayload(pool, req, existingTemplate) {
|
||||
let regions = extractTemplateRegions(req.body);
|
||||
const filesByField = getFilesByField(req.files || []);
|
||||
const backgroundImage = filesByField.background_image;
|
||||
const removeBackgroundImage = Boolean(req.body.remove_background_image);
|
||||
const backgroundImagePath = backgroundImage
|
||||
? `/uploads/${backgroundImage.filename}`
|
||||
: String(req.body.existing_background_image_path || (existingTemplate && existingTemplate.background_image_path) || '').trim() || null;
|
||||
: removeBackgroundImage
|
||||
? null
|
||||
: String(req.body.existing_background_image_path || (existingTemplate && existingTemplate.background_image_path) || '').trim() || null;
|
||||
|
||||
if (!name) {
|
||||
const error = new Error('Template name is required.');
|
||||
|
||||
Reference in New Issue
Block a user