From 33b0a8267bebe9202b07ce7f03a0e8de2083421a Mon Sep 17 00:00:00 2001 From: "Sven (AAMOS AI)" Date: Tue, 11 Aug 2026 02:47:25 +0700 Subject: [PATCH] =?UTF-8?q?fix(ops):=20interpolera=20varum=C3=A4rke=20i=20?= =?UTF-8?q?wall=20board=20fr=C3=A5n=20brand.config.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/api/src/routes/ops.ts | 14 +++++++++++++- packages/database/src/ops-summary.ts | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/api/src/routes/ops.ts b/apps/api/src/routes/ops.ts index 2165637..cd53a40 100644 --- a/apps/api/src/routes/ops.ts +++ b/apps/api/src/routes/ops.ts @@ -1,5 +1,6 @@ import { timingSafeEqual } from "node:crypto"; import type { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; +import BRAND from "../../../../brand.config.json" with { type: "json" }; import { errors } from "../lib/errors.js"; const CACHE_KEY = "ops:summary:cache"; @@ -54,8 +55,19 @@ export async function opsRoutes(app: FastifyInstance) { .send({ error: { code: "CACHE_INVALID", message: "Cachen innehÄller ogiltig JSON." } }); } + const enriched = structuredClone(summary); + if ( + enriched.wall && + typeof enriched.wall === "object" && + Array.isArray((enriched.wall as Record).boards) + ) { + for (const board of (enriched.wall as { boards: Array<{ title?: string }> }).boards) { + if (board.title === "{brand}") board.title = BRAND.name; + } + } + return reply.send({ - ...summary, + ...enriched, cached_at: ts ?? summary.as_of, }); }); diff --git a/packages/database/src/ops-summary.ts b/packages/database/src/ops-summary.ts index 4c23628..25c9715 100644 --- a/packages/database/src/ops-summary.ts +++ b/packages/database/src/ops-summary.ts @@ -588,7 +588,7 @@ export function buildWall(summary: OpsSummary): OpsWallBlock { ]; return { - boards: [{ title: "Cibello", tiles }], + boards: [{ title: "{brand}", tiles }], }; }