feat(rack): add shift-click context modal for connections with color and edge type configurability
This commit is contained in:
@@ -6,14 +6,25 @@ const router = Router();
|
||||
// POST /api/connections
|
||||
router.post('/', async (req, res, next) => {
|
||||
try {
|
||||
const { fromPortId, toPortId, color, label } = req.body;
|
||||
const conn = await connService.createConnection({ fromPortId, toPortId, color, label });
|
||||
const { fromPortId, toPortId, color, label, edgeType } = req.body;
|
||||
const conn = await connService.createConnection({ fromPortId, toPortId, color, label, edgeType });
|
||||
res.status(201).json(conn);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
// PUT /api/connections/:id
|
||||
router.put('/:id', async (req, res, next) => {
|
||||
try {
|
||||
const { color, label, edgeType } = req.body;
|
||||
const conn = await connService.updateConnection(req.params.id, { color, label, edgeType });
|
||||
res.json(conn);
|
||||
} catch (err) {
|
||||
next(err);
|
||||
}
|
||||
});
|
||||
|
||||
// DELETE /api/connections/:id
|
||||
router.delete('/:id', async (req, res, next) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user