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.

506 B
Raw Blame
import { domainDeletedJob } from "@/lib/jobs/handlers/domain-deleted-job";
import { prisma } from "@/lib/prisma";

// Mark the domain as deleted
// We'll delete the domain and its links via a background job
export async function markDomainAsDeleted({ domain }: { domain: string }) {
  await prisma.domain.update({
    where: {
      slug: domain,
    },
    data: {
      projectId: null,
    },
  });

  await domainDeletedJob.dispatch(
    {
      domain,
    },
    {
      label: domain,
    },
  );
}