first commit
CI / lint-and-test (push) Canceled after 0s

This commit is contained in:
Alberto-Audrix committed 2026-07-28 08:55:05 +07:00
commit 32a36cceff
444 files changed
+67186

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
const express = require('express');
const router = express.Router();
const FeedSackColumnConfig = require('../models/FeedSackColumnConfig');
// GET /api/feed-sack-column-config - Get column configuration
router.get('/', async (req, res) => {
try {
const config = await FeedSackColumnConfig.get();
res.json({ success: true, data: config || [] });
} catch (error) {
res.status(500).json({ success: false, error: error.message });
}
});
// PUT /api/feed-sack-column-config - Save column configuration
router.put('/', async (req, res) => {
try {
const { config } = req.body;
if (!Array.isArray(config)) {
return res.status(400).json({ success: false, error: 'config must be an array' });
}
const saved = await FeedSackColumnConfig.save(config);
res.json({ success: true, data: saved });
} catch (error) {
res.status(500).json({ success: false, error: error.message });
}
});
module.exports = router;