Persist distribution board setup

This commit is contained in:
2026-07-25 23:41:27 +02:00
parent 1a77eedaa8
commit 1cf26a932e
21 changed files with 1027 additions and 22 deletions
+11 -3
View File
@@ -177,15 +177,23 @@ export default function ProjectDetailPage() {
async function handleCreateBoard(event: FormEvent<HTMLFormElement>) {
event.preventDefault();
if (!projectId || !boardName.trim()) {
if (!projectId || !project || !boardName.trim()) {
return;
}
setIsSaving(true);
setError(null);
try {
const created = await createDistributionBoard(projectId, boardName.trim());
setBoards((current) => [...current, created]);
const result = await createDistributionBoard(
projectId,
boardName.trim(),
project.currentRevision
);
setBoards((current) => [
...current,
result.distributionBoard,
]);
setCircuitLists(await listCircuitLists(projectId));
applyProjectRevision(result.history.currentRevision);
setBoardName("");
} catch (err) {
setError(err instanceof Error ? err.message : "Verteilung konnte nicht erstellt werden.");