fix(beszel): review fixes for MCP and widget styling
- Throw TRPCError instead of returning null when no integration - Sort beszelRouter import alphabetically in mcp.ts - Replace ternary with lookup table for background color - Mention integration_all in MCP server instructions
This commit is contained in:
4 files changed
+8
-4
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { TRPCError } from "@trpc/server";
|
||||
import { observable } from "@trpc/server/observable";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
@@ -160,7 +161,9 @@ export const beszelRouter = createTRPCRouter({
|
||||
)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const integration = ctx.integrations[0];
|
||||
if (!integration) return null;
|
||||
if (!integration) {
|
||||
throw new TRPCError({ code: "BAD_REQUEST", message: "At least one Beszel integrationId is required" });
|
||||
}
|
||||
const innerHandler = beszelStatsRequestHandler.handler(integration, {
|
||||
systemId: input.systemId,
|
||||
timePeriod: input.timePeriod,
|
||||
|
||||
Reference in new issue
Block a user