Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

chore: Update workspace API route to include domains in response

Kiran Ka45e2a746ddd
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
index c6a11b1a2a..0c2f1394f1 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/route.ts
@@ -35,11 +35,21 @@ const updateWorkspaceSchema = z.object({
// GET /api/workspaces/[idOrSlug] – get a specific workspace by id or slug
export const GET = withWorkspace(async ({ workspace, headers }) => {
const betaTester = await isBetaTester(workspace.id);
+ const domains = await prisma.domain.findMany({
+ where: {
+ projectId: workspace.id,
+ },
+ select: {
+ slug: true,
+ primary: true,
+ },
+ });
return NextResponse.json(
WorkspaceSchema.parse({
...workspace,
id: `ws_${workspace.id}`,
+ domains,
betaTester,
}),
{ headers },