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.

fix duplicate tag error + add sitemap

Steven Tey1e01ae1d9b2d
diff --git a/apps/web/app/sitemap.ts b/apps/web/app/sitemap.ts
index c70f55d8ce..e53faacf51 100644
--- a/apps/web/app/sitemap.ts
+++ b/apps/web/app/sitemap.ts
@@ -1,4 +1,6 @@
-import { SHORT_DOMAIN } from "@dub/utils";
+import { prisma } from "@dub/prisma";
+import { Prisma } from "@dub/prisma/client";
+import { PARTNERS_HOSTNAMES, SHORT_DOMAIN } from "@dub/utils";
import { MetadataRoute } from "next";
import { headers } from "next/headers";
@@ -11,6 +13,21 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
domain = SHORT_DOMAIN;
}
+ if (PARTNERS_HOSTNAMES.has(domain)) {
+ const programs = await prisma.program.findMany({
+ where: {
+ landerData: {
+ not: Prisma.JsonNull,
+ },
+ },
+ });
+
+ return programs.map((program) => ({
+ url: `https://partners.dub.co/${program.slug}`,
+ lastModified: new Date(),
+ }));
+ }
+
return [
{
url: `https://${domain}`,
diff --git a/apps/web/ui/links/link-builder/tag-select.tsx b/apps/web/ui/links/link-builder/tag-select.tsx
index bffaf84ef9..360d04c1b4 100644
--- a/apps/web/ui/links/link-builder/tag-select.tsx
+++ b/apps/web/ui/links/link-builder/tag-select.tsx
@@ -188,6 +188,9 @@ export const TagSelect = memo(() => {
),
{ shouldDirty: true },
);
+ setSuggestedTags((tags) =>
+ tags.filter(({ id }) => !selectedIds.includes(id)),
+ );
}}
options={loadingTags ? undefined : options}
icon={<Tag className="mt-[5px] size-4 text-neutral-500" />}