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.

revert DEFAULT_LINK_PROPS change

Steven Teyb4db02f77914
diff --git a/apps/web/app/api/domains/route.ts b/apps/web/app/api/domains/route.ts
index 01e1613d82..8438c9fc84 100644
--- a/apps/web/app/api/domains/route.ts
+++ b/apps/web/app/api/domains/route.ts
@@ -91,7 +91,7 @@ export const POST = withWorkspace(
return new Response(vercelResponse.error.message, { status: 422 });
}
- const [domainRecord, res] = await Promise.all([
+ const [domainRecord, _] = await Promise.all([
prisma.domain.create({
data: {
slug: slug,
@@ -108,13 +108,12 @@ export const POST = withWorkspace(
domain: slug,
key: "_root",
url: "",
+ tags: undefined,
userId: session.user.id,
projectId: workspace.id,
}),
]);
- console.log({ res });
-
return NextResponse.json(DomainSchema.parse(domainRecord), {
status: 201,
});
diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsx
index b54ad5e52d..f78532a64e 100644
--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx
@@ -400,7 +400,7 @@ function AddEditLinkModal({
const bodyData = {
...rest,
// Map tags to tagIds
- tagIds: tags?.map(({ id }) => id),
+ tagIds: tags.map(({ id }) => id),
};
fetch(endpoint.url, {
method: endpoint.method,
diff --git a/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx b/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx
index 96879b387c..1627e42947 100644
--- a/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx
+++ b/apps/web/ui/modals/add-edit-link-modal/tags-section.tsx
@@ -72,7 +72,7 @@ export default function TagsSection({
title &&
description &&
!exceededAI &&
- tags?.length === 0 &&
+ tags.length === 0 &&
suggestedTags.length === 0 &&
availableTags &&
availableTags.length > 0
@@ -199,9 +199,11 @@ export default function TagsSection({
)}
</div>
<div className="flex flex-wrap space-x-1.5 px-8">
- {tags?.map((tag) => <TagBadge key={tag.id} {...tag} />)}
+ {tags.map((tag) => (
+ <TagBadge key={tag.id} {...tag} />
+ ))}
<CommandInput />
- {tags?.length ? (
+ {tags.length ? (
<button
type="button"
onClick={() => {
@@ -257,7 +259,7 @@ export default function TagsSection({
className="group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-selected:bg-gray-100 aria-selected:text-gray-900"
>
<TagBadge {...tag} />
- {tags?.map(({ id }) => id).includes(tag.id) && (
+ {tags.map(({ id }) => id).includes(tag.id) && (
<Check className="h-5 w-5 text-gray-500" />
)}
</Command.Item>
diff --git a/packages/utils/src/constants/misc.ts b/packages/utils/src/constants/misc.ts
index 800c5e3790..4e57676476 100644
--- a/packages/utils/src/constants/misc.ts
+++ b/packages/utils/src/constants/misc.ts
@@ -3,6 +3,7 @@ export const DEFAULT_LINK_PROPS: any = {
url: "",
domain: "",
archived: false,
+ tags: [],
title: null,
description: null,