Skip to content

⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.

minor fix

daniel31x13dfbd56acc912
diff --git a/components/LinkViews/LinkCard.tsx b/components/LinkViews/LinkCard.tsx
index 3efed9d9..232a0262 100644
--- a/components/LinkViews/LinkCard.tsx
+++ b/components/LinkViews/LinkCard.tsx
@@ -62,8 +62,6 @@ export default function LinkGrid({ link, count, className }: Props) {
!link.preview?.startsWith("archives") &&
link.preview !== "unavailable"
) {
- getLink(link.id as number);
-
interval = setInterval(async () => {
getLink(link.id as number);
}, 5000);
diff --git a/components/LinkViews/LinkComponents/LinkActions.tsx b/components/LinkViews/LinkComponents/LinkActions.tsx
index 777fe5f8..d2303736 100644
--- a/components/LinkViews/LinkComponents/LinkActions.tsx
+++ b/components/LinkViews/LinkComponents/LinkActions.tsx
@@ -114,7 +114,7 @@ export default function LinkActions({
setEditLinkModal(true);
}}
>
- Edit
+ Edit Link
</div>
</li>
) : undefined}
diff --git a/lib/api/controllers/dashboard/getDashboardData.ts b/lib/api/controllers/dashboard/getDashboardData.ts
index c43a8698..c75f9c00 100644
--- a/lib/api/controllers/dashboard/getDashboardData.ts
+++ b/lib/api/controllers/dashboard/getDashboardData.ts
@@ -6,8 +6,8 @@ export default async function getDashboardData(
query: LinkRequestQuery
) {
let order: any;
- if (query.sort === Sort.DateNewestFirst) order = { createdAt: "desc" };
- else if (query.sort === Sort.DateOldestFirst) order = { createdAt: "asc" };
+ if (query.sort === Sort.DateNewestFirst) order = { id: "desc" };
+ else if (query.sort === Sort.DateOldestFirst) order = { id: "asc" };
else if (query.sort === Sort.NameAZ) order = { name: "asc" };
else if (query.sort === Sort.NameZA) order = { name: "desc" };
else if (query.sort === Sort.DescriptionAZ) order = { description: "asc" };
@@ -42,7 +42,7 @@ export default async function getDashboardData(
select: { id: true },
},
},
- orderBy: order || { createdAt: "desc" },
+ orderBy: order || { id: "desc" },
});
const recentlyAddedLinks = await prisma.link.findMany({
@@ -67,11 +67,11 @@ export default async function getDashboardData(
select: { id: true },
},
},
- orderBy: order || { createdAt: "desc" },
+ orderBy: order || { id: "desc" },
});
const links = [...recentlyAddedLinks, ...pinnedLinks].sort(
- (a, b) => (new Date(b.createdAt) as any) - (new Date(a.createdAt) as any)
+ (a, b) => (new Date(b.id) as any) - (new Date(a.id) as any)
);
return { response: links, status: 200 };