forked from jappel/leistungsbilanz-ts
Added 1B, 2 and added bootstrap again for site
This commit is contained in:
parent
b8995b3a1b
commit
d1ce485572
37 changed files with 1842 additions and 89 deletions
19
src/server/controllers/circuit-section.controller.ts
Normal file
19
src/server/controllers/circuit-section.controller.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { Request, Response } from "express";
|
||||
import { CircuitWriteService } from "../../domain/services/circuit-write.service.js";
|
||||
|
||||
const circuitWriteService = new CircuitWriteService();
|
||||
|
||||
export async function renumberCircuitSection(req: Request, res: Response) {
|
||||
const { sectionId } = req.params;
|
||||
if (typeof sectionId !== "string") {
|
||||
return res.status(400).json({ error: "Invalid sectionId" });
|
||||
}
|
||||
|
||||
try {
|
||||
const updatedCircuits = await circuitWriteService.renumberSection(sectionId);
|
||||
return res.json({ sectionId, circuits: updatedCircuits });
|
||||
} catch (error) {
|
||||
return res.status(400).json({ error: error instanceof Error ? error.message : "Failed to renumber section." });
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue