Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
677 B ยท 26 lines
TypeScript
at incident-api
123456789101112131415161718192021222324252627import { and, eq } from "@openstatus/db";import { pageComponentGroup } from "@openstatus/db/src/schema";
import type { DB } from "../context";import { NotFoundError } from "../errors";
/** Load a group by id, scoped to the workspace. */export async function getGroupInWorkspace(args: { tx: DB; id: number; workspaceId: number;}) { const { tx, id, workspaceId } = args; const row = await tx .select() .from(pageComponentGroup) .where( and( eq(pageComponentGroup.id, id), eq(pageComponentGroup.workspaceId, workspaceId), ), ) .get(); if (!row) throw new NotFoundError("page_component_group", id); return row;}