fix(rack-planner): accept sfpCount and wanCount in module creation API route
This commit is contained in:
@@ -61,7 +61,7 @@ racksRouter.delete('/:id', async (req: Request, res: Response, next: NextFunctio
|
||||
|
||||
racksRouter.post('/:id/modules', async (req: Request, res: Response, next: NextFunction) => {
|
||||
try {
|
||||
const { name, type, uPosition, uSize, manufacturer, model, ipAddress, notes, portCount, portType } =
|
||||
const { name, type, uPosition, uSize, manufacturer, model, ipAddress, notes, portCount, portType, sfpCount, wanCount } =
|
||||
req.body as {
|
||||
name: string;
|
||||
type: ModuleType;
|
||||
@@ -73,9 +73,11 @@ racksRouter.post('/:id/modules', async (req: Request, res: Response, next: NextF
|
||||
notes?: string;
|
||||
portCount?: number;
|
||||
portType?: PortType;
|
||||
sfpCount?: number;
|
||||
wanCount?: number;
|
||||
};
|
||||
res.status(201).json(
|
||||
ok(await moduleService.createModule(req.params.id, { name, type, uPosition, uSize, manufacturer, model, ipAddress, notes, portCount, portType }))
|
||||
ok(await moduleService.createModule(req.params.id, { name, type, uPosition, uSize, manufacturer, model, ipAddress, notes, portCount, portType, sfpCount, wanCount }))
|
||||
);
|
||||
} catch (e) {
|
||||
next(e);
|
||||
|
||||
Reference in New Issue
Block a user