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.

pass user to processLink

Steven Teyaa8fdaf60206
diff --git a/apps/web/app/(ee)/api/cron/import/csv/route.ts b/apps/web/app/(ee)/api/cron/import/csv/route.ts
index 99ed48d685..ff02e48bbf 100644
--- a/apps/web/app/(ee)/api/cron/import/csv/route.ts
+++ b/apps/web/app/(ee)/api/cron/import/csv/route.ts
@@ -4,7 +4,7 @@ import { handleAndReturnErrorResponse } from "@/lib/api/errors";
import { bulkCreateLinks, createLink, processLink } from "@/lib/api/links";
import { qstash } from "@/lib/cron";
import { verifyQstashSignature } from "@/lib/cron/verify-qstash";
-import { ProcessedLinkProps, WorkspaceProps } from "@/lib/types";
+import { ProcessedLinkProps } from "@/lib/types";
import { redis } from "@/lib/upstash";
import { linkMappingSchema } from "@/lib/zod/schemas/import-csv";
import { createLinkBodySchema } from "@/lib/zod/schemas/links";
@@ -384,6 +384,11 @@ const processMappedLinks = async ({
select: {
id: true,
plan: true,
+ users: {
+ where: {
+ userId,
+ },
+ },
},
});
@@ -397,11 +402,7 @@ const processMappedLinks = async ({
folderId,
}),
},
- workspace: {
- id: workspaceId,
- plan: workspace.plan as WorkspaceProps["plan"],
- users: [{ role: "owner" }],
- },
+ workspace,
userId,
bulk: true,
}),