ваше сообщение коммита

This commit is contained in:
2025-09-02 15:33:18 +03:00
parent c007c0b296
commit a6360ccd2e
21 changed files with 1269 additions and 316 deletions

View File

@@ -40,7 +40,8 @@ router.post('/logo', auth.requireAuth, auth.requireAdmin, upload.single('logo'),
if (!req.file) return res.status(400).json({ success: false, message: 'Файл не получен' });
const rel = path.posix.join('uploads', 'logos', path.basename(req.file.filename));
const urlPath = `/uploads/logos/${path.basename(req.file.filename)}`;
return res.json({ success: true, data: { path: rel, url: urlPath } });
const fullUrl = `http://localhost:8000${urlPath}`;
return res.json({ success: true, data: { path: rel, url: fullUrl } });
} catch (e) {
return res.status(500).json({ success: false, message: e.message });
}