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.

edit r2 directory

Steven Tey720257e31df3
diff --git a/apps/web/app/api/workspaces/[idOrSlug]/logo/route.ts b/apps/web/app/api/workspaces/[idOrSlug]/logo/route.ts
index 15afd2d63e..d15daba931 100644
--- a/apps/web/app/api/workspaces/[idOrSlug]/logo/route.ts
+++ b/apps/web/app/api/workspaces/[idOrSlug]/logo/route.ts
@@ -13,7 +13,10 @@ export const POST = withAuth(
async ({ req, workspace }) => {
const { image } = uploadLogoSchema.parse(await req.json());
- const { url } = await storage.upload(`logos/${workspace.id}`, image);
+ const { url } = await storage.upload(
+ `workspaces/${workspace.id}/logo`,
+ image,
+ );
const response = await prisma.project.update({
where: { id: workspace.id },
diff --git a/apps/web/lib/api/workspaces.ts b/apps/web/lib/api/workspaces.ts
index e9041c581c..1111cf46d3 100644
--- a/apps/web/lib/api/workspaces.ts
+++ b/apps/web/lib/api/workspaces.ts
@@ -76,7 +76,7 @@ export async function deleteWorkspace(
const deleteWorkspaceResponse = await Promise.all([
// delete workspace logo if it's a custom logo stored in R2
workspace.logo?.startsWith(process.env.STORAGE_BASE_URL as string) &&
- storage.delete(`logos/${workspace.id}`),
+ storage.delete(`workspaces/${workspace.id}/logo`),
// if they have a Stripe subscription, cancel it
workspace.stripeId && cancelSubscription(workspace.stripeId),
// delete the workspace
@@ -132,7 +132,7 @@ export async function deleteWorkspaceAdmin(
const deleteWorkspaceResponse = await Promise.all([
// delete workspace logo if it's a custom logo stored in R2
workspace.logo?.startsWith(process.env.STORAGE_BASE_URL as string) &&
- storage.delete(`logos/${workspace.id}`),
+ storage.delete(`workspaces/${workspace.id}/logo`),
// if they have a Stripe subscription, cancel it
workspace.stripeId && cancelSubscription(workspace.stripeId),
// delete the workspace