Initial scaffold: full-stack RackMapper application
Complete project scaffold with working auth, REST API, Prisma/SQLite schema, Docker config, and React frontend for both Rack Planner and Service Mapper modules. Both server and client pass TypeScript strict mode with zero errors. Initial migration applied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
28
server/routes/edges.ts
Normal file
28
server/routes/edges.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { Router, Request, Response, NextFunction } from 'express';
|
||||
import * as mapService from '../services/mapService';
|
||||
import { ok } from '../types/index';
|
||||
|
||||
export const edgesRouter = Router();
|
||||
|
||||
edgesRouter.put('/:id', async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const { label, edgeType, animated, metadata } = req.body as {
|
||||
label?: string;
|
||||
edgeType?: string;
|
||||
animated?: boolean;
|
||||
metadata?: string;
|
||||
};
|
||||
res.json(ok(await mapService.updateEdge(req.params.id, { label, edgeType, animated, metadata })));
|
||||
} catch (e) {
|
||||
next(e);
|
||||
}
|
||||
});
|
||||
|
||||
edgesRouter.delete('/:id', async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
await mapService.deleteEdge(req.params.id);
|
||||
res.json(ok(null));
|
||||
} catch (e) {
|
||||
next(e);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user