refactor backend and persist stock campaign queue
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m32s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m32s
This commit is contained in:
17
backend/routes/internalRoutes.js
Normal file
17
backend/routes/internalRoutes.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const express = require('express');
|
||||
const { authenticateAPIKey } = require('../auth');
|
||||
const { processPendingStockCampaigns } = require('../services/campaignService');
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/process-stock-campaigns', authenticateAPIKey, async (req, res) => {
|
||||
try {
|
||||
const summary = await processPendingStockCampaigns();
|
||||
res.json(summary);
|
||||
} catch (error) {
|
||||
console.error('Error processing stock campaigns:', error);
|
||||
res.status(500).json({ error: 'Internal Server Error' });
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
Reference in New Issue
Block a user