Refactor file handling in BuyProduct and Request models; implement file schema for better structure. Update routes to handle file uploads and downloads with improved error handling and logging. Adjust MongoDB connection management across scripts and routes for consistency.

This commit is contained in:
2025-11-05 19:06:11 +03:00
parent 41b5cb6fae
commit 284be82e1e
15 changed files with 630 additions and 184 deletions

View File

@@ -5,7 +5,8 @@ const Company = require('../models/Company');
const Experience = require('../models/Experience');
const Request = require('../models/Request');
const Message = require('../models/Message');
const { Types } = require('mongoose');
const mongoose = require('../../../utils/mongoose');
const { Types } = mongoose;
// GET /my/info - получить мою компанию (требует авторизации) - ДОЛЖНО быть ПЕРЕД /:id
router.get('/my/info', verifyToken, async (req, res) => {