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:
21
server/routes/ports.ts
Normal file
21
server/routes/ports.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { Router, Request, Response, NextFunction } from 'express';
|
||||
import * as portService from '../services/portService';
|
||||
import { ok } from '../types/index';
|
||||
import type { VlanMode } from '../lib/constants';
|
||||
|
||||
export const portsRouter = Router();
|
||||
|
||||
portsRouter.put('/:id', async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const { label, mode, nativeVlan, notes, vlans } = req.body as {
|
||||
label?: string;
|
||||
mode?: VlanMode;
|
||||
nativeVlan?: number | null;
|
||||
notes?: string;
|
||||
vlans?: Array<{ vlanId: string; tagged: boolean }>;
|
||||
};
|
||||
res.json(ok(await portService.updatePort(req.params.id, { label, mode, nativeVlan, notes, vlans })));
|
||||
} catch (e) {
|
||||
next(e);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user