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.

decrement

Steven Tey55b3cda54f3c
diff --git a/apps/web/app/api/links/[linkId]/transfer/route.ts b/apps/web/app/api/links/[linkId]/transfer/route.ts
index cf32e55624..ca1643a8fe 100644
--- a/apps/web/app/api/links/[linkId]/transfer/route.ts
+++ b/apps/web/app/api/links/[linkId]/transfer/route.ts
@@ -94,20 +94,6 @@ export const POST = withWorkspace(
workspace_id: newWorkspaceId,
created_at: link.createdAt,
}),
- // decrement old workspace usage
- prisma.project.update({
- where: {
- id: workspace.id,
- },
- data: {
- usage: {
- decrement: linkClicks,
- },
- linksUsage: {
- decrement: 1,
- },
- },
- }),
// increment new workspace usage
prisma.project.update({
where: {
diff --git a/apps/web/lib/api/links/delete-link.ts b/apps/web/lib/api/links/delete-link.ts
index 3b8390bd8a..fbb29184fe 100644
--- a/apps/web/lib/api/links/delete-link.ts
+++ b/apps/web/lib/api/links/delete-link.ts
@@ -31,17 +31,6 @@ export async function deleteLink(linkId: string) {
created_at: link.createdAt,
deleted: true,
}),
- link.projectId &&
- prisma.project.update({
- where: {
- id: link.projectId,
- },
- data: {
- linksUsage: {
- decrement: 1,
- },
- },
- }),
]),
);