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.

include workspace id in admin

Steven Teyb1a131ca7daa
diff --git a/apps/web/app/admin.dub.co/(dashboard)/components/user-info.tsx b/apps/web/app/admin.dub.co/(dashboard)/components/user-info.tsx
index dd2a775b73..de346bf7ae 100644
--- a/apps/web/app/admin.dub.co/(dashboard)/components/user-info.tsx
+++ b/apps/web/app/admin.dub.co/(dashboard)/components/user-info.tsx
@@ -9,6 +9,7 @@ export interface UserInfoProps {
email: string;
defaultDomainLinks: Record<string, number>;
workspaces: {
+ id: string;
name: string;
slug: string;
plan: string;
@@ -75,6 +76,10 @@ export default function UserInfo({ data }: { data: UserInfoProps }) {
<p className="font-semibold">{workspace.name}</p>
<Badge className="lowercase">{workspace.slug}</Badge>
</div>
+ <div className="flex justify-between text-sm">
+ <span className="font-medium text-gray-700">ID</span>
+ <span className="text-gray-500">{workspace.id}</span>
+ </div>
<div className="flex justify-between text-sm">
<span className="font-medium text-gray-700">Plan</span>
<span className="text-gray-500">
diff --git a/apps/web/app/api/admin/impersonate/route.ts b/apps/web/app/api/admin/impersonate/route.ts
index 96f09d3e5c..837ccbc528 100644
--- a/apps/web/app/api/admin/impersonate/route.ts
+++ b/apps/web/app/api/admin/impersonate/route.ts
@@ -37,6 +37,7 @@ export const POST = withAdmin(async ({ req }) => {
select: {
project: {
select: {
+ id: true,
name: true,
slug: true,
plan: true,
@@ -74,6 +75,7 @@ export const POST = withAdmin(async ({ req }) => {
),
workspaces: response.projects.map(({ project }) => ({
...project,
+ id: `ws_${project.id}`,
clicks: project.usage,
domains: project._count.domains,
links: project._count.links,
diff --git a/apps/web/scripts/update-spam-links.ts b/apps/web/scripts/update-spam-links.ts
new file mode 100644
index 0000000000..4c61c4cd80
--- /dev/null
+++ b/apps/web/scripts/update-spam-links.ts
@@ -0,0 +1,20 @@
+import { prisma } from "@/lib/prisma";
+import "dotenv-flow/config";
+
+async function main() {
+ const updateOwner = await prisma.link.updateMany({
+ where: {
+ url: {
+ contains: "evirtualservices.co",
+ },
+ userId: null,
+ },
+ data: {
+ userId: "clqei1lgc0000vsnzi01pbf47",
+ },
+ });
+
+ console.log(updateOwner);
+}
+
+main();