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.

fixed edit link bug, updated prisma

Steven Tey4a6cd86f4f01
diff --git a/app/ui/modals/add-edit-link-modal/tags-section.tsx b/app/ui/modals/add-edit-link-modal/tags-section.tsx
index dece4d75a3..3476f26f7f 100644
--- a/app/ui/modals/add-edit-link-modal/tags-section.tsx
+++ b/app/ui/modals/add-edit-link-modal/tags-section.tsx
@@ -55,7 +55,8 @@ export default function TagsSection({
toast.success(`Successfully created tag!`);
setCreatingTag(false);
} else {
- toast.error(`Error creating tag!`);
+ const error = await res.text();
+ toast.error(error);
}
});
};
diff --git a/components/app/modals/add-edit-link-modal/index.tsx b/components/app/modals/add-edit-link-modal/index.tsx
index 3a572dee95..b27f528903 100644
--- a/components/app/modals/add-edit-link-modal/index.tsx
+++ b/components/app/modals/add-edit-link-modal/index.tsx
@@ -321,12 +321,14 @@ function AddEditLinkModal({
onSubmit={async (e) => {
e.preventDefault();
setSaving(true);
+ // @ts-ignore – exclude the extra `user` attribute from `data` object before sending to API
+ const { user, ...rest } = data;
fetch(endpoint.url, {
method: endpoint.method,
headers: {
"Content-Type": "application/json",
},
- body: JSON.stringify(data),
+ body: JSON.stringify(rest),
}).then(async (res) => {
setSaving(false);
if (res.status === 200) {
diff --git a/lib/api/links.ts b/lib/api/links.ts
index b33e8037ba..7f2b19221a 100644
--- a/lib/api/links.ts
+++ b/lib/api/links.ts
@@ -26,9 +26,6 @@ export async function getLinksForProject({
userId?: string | null;
showArchived?: boolean;
}): Promise<LinkProps[]> {
- /*
- TODO: add pagination
- */
return await prisma.link.findMany({
where: {
projectId,
diff --git a/package.json b/package.json
index 242ce7ccbc..11fa04f321 100644
--- a/package.json
+++ b/package.json
@@ -13,7 +13,7 @@
"@boxyhq/saml-jackson": "^1.11.3",
"@next-auth/prisma-adapter": "^1.0.5",
"@planetscale/database": "^1.7.0",
- "@prisma/client": "^4.13.0",
+ "@prisma/client": "^5.2.0",
"@radix-ui/react-accordion": "^1.0.1",
"@radix-ui/react-navigation-menu": "^1.1.2",
"@radix-ui/react-popover": "^1.0.5",
@@ -64,7 +64,7 @@
"node-html-parser": "^6.1.4",
"nodemailer": "^6.9.3",
"npm": "^9.1.2",
- "prisma": "^4.13.0",
+ "prisma": "^5.2.0",
"punycode": "^2.3.0",
"react": "^18.2.0",
"react-colorful": "^5.6.1",
diff --git a/yarn.lock b/yarn.lock
index 139dc52b16..cdd107000c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2214,22 +2214,22 @@
resolved "https://registry.npmjs.org/@planetscale/database/-/database-1.7.0.tgz"
integrity sha512-lWR6biXChUyQnxsT4RT1CIeR3ZJvwTQXiQ+158MnY3VjLwjHEGakDzdH9kwUGPk6CHvu6UeqRXp1DgUOVHJFTw==
-"@prisma/client@^4.13.0":
- version "4.13.0"
- resolved "https://registry.npmjs.org/@prisma/client/-/client-4.13.0.tgz"
- integrity sha512-YaiiICcRB2hatxsbnfB66uWXjcRw3jsZdlAVxmx0cFcTc/Ad/sKdHCcWSnqyDX47vAewkjRFwiLwrOUjswVvmA==
+"@prisma/client@^5.2.0":
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/@prisma/client/-/client-5.2.0.tgz#cbfdd440614b38736563a7999f39922fcde0ed50"
+ integrity sha512-AiTjJwR4J5Rh6Z/9ZKrBBLel3/5DzUNntMohOy7yObVnVoTNVFi2kvpLZlFuKO50d7yDspOtW6XBpiAd0BVXbQ==
dependencies:
- "@prisma/engines-version" "4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a"
+ "@prisma/engines-version" "5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f"
-"@prisma/engines-version@4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a":
- version "4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a"
- resolved "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.13.0-50.1e7af066ee9cb95cf3a403c78d9aab3e6b04f37a.tgz"
- integrity sha512-fsQlbkhPJf08JOzKoyoD9atdUijuGBekwoOPZC3YOygXEml1MTtgXVpnUNchQlRSY82OQ6pSGQ9PxUe4arcSLQ==
+"@prisma/engines-version@5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f":
+ version "5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f"
+ resolved "https://registry.yarnpkg.com/@prisma/engines-version/-/engines-version-5.2.0-25.2804dc98259d2ea960602aca6b8e7fdc03c1758f.tgz#11366e7ff031c908debf4983248d40046016de37"
+ integrity sha512-jsnKT5JIDIE01lAeCj2ghY9IwxkedhKNvxQeoyLs6dr4ZXynetD0vTy7u6wMJt8vVPv8I5DPy/I4CFaoXAgbtg==
-"@prisma/[email protected]":
- version "4.13.0"
- resolved "https://registry.npmjs.org/@prisma/engines/-/engines-4.13.0.tgz"
- integrity sha512-HrniowHRZXHuGT9XRgoXEaP2gJLXM5RMoItaY2PkjvuZ+iHc0Zjbm/302MB8YsPdWozAPHHn+jpFEcEn71OgPw==
+"@prisma/[email protected]":
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/@prisma/engines/-/engines-5.2.0.tgz#e5dff48eb324c8137393933292d44ea5c3bc2ce7"
+ integrity sha512-dT7FOLUCdZmq+AunLqB1Iz+ZH/IIS1Fz2THmKZQ6aFONrQD/BQ5ecJ7g2wGS2OgyUFf4OaLam6/bxmgdOBDqig==
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
@@ -9299,12 +9299,12 @@ [email protected]:
extend-shallow "^2.0.1"
js-beautify "^1.6.12"
-prisma@^4.13.0:
- version "4.13.0"
- resolved "https://registry.npmjs.org/prisma/-/prisma-4.13.0.tgz"
- integrity sha512-L9mqjnSmvWIRCYJ9mQkwCtj4+JDYYTdhoyo8hlsHNDXaZLh/b4hR0IoKIBbTKxZuyHQzLopb/+0Rvb69uGV7uA==
+prisma@^5.2.0:
+ version "5.2.0"
+ resolved "https://registry.yarnpkg.com/prisma/-/prisma-5.2.0.tgz#a302dc2635cdec1d22d552ece837fb29a03563b9"
+ integrity sha512-FfFlpjVCkZwrqxDnP4smlNYSH1so+CbfjgdpioFzGGqlQAEm6VHAYSzV7jJgC3ebtY9dNOhDMS2+4/1DDSM7bQ==
dependencies:
- "@prisma/engines" "4.13.0"
+ "@prisma/engines" "5.2.0"
proc-log@^3.0.0:
version "3.0.0"