⚡️⚡️⚡️ Self-hosted collaborative bookmark manager to collect, read, annotate, and fully preserve what matters, all in one place.
TypeScript bookmarkbookmark-managercollaborationnextjsreact-nativeread-it-laterself-hostedtypescript
remove unused code
daniel31x1392a66933ce0a
diff --git a/hooks/store/links.tsx b/hooks/store/links.tsxindex d75da097..44e406fe 100644--- a/hooks/store/links.tsx+++ b/hooks/store/links.tsx@@ -30,11 +30,6 @@ const useLinks = (params: LinkRequestQuery = {}) => {params.pinnedOnly ??(router.pathname === "/links/pinned" ? true : undefined),searchQueryString: params.searchQueryString,- searchByName: params.searchByName,- searchByUrl: params.searchByUrl,- searchByDescription: params.searchByDescription,- searchByTextContent: params.searchByTextContent,- searchByTags: params.searchByTags,} as LinkRequestQuery;const queryString = buildQueryString(queryParamsObject);diff --git a/hooks/store/publicLinks.tsx b/hooks/store/publicLinks.tsxindex 86c79619..dff349d1 100644--- a/hooks/store/publicLinks.tsx+++ b/hooks/store/publicLinks.tsx@@ -25,11 +25,6 @@ const usePublicLinks = (params: LinkRequestQuery = {}) => {? true: undefined,searchQueryString: params.searchQueryString,- searchByName: params.searchByName,- searchByUrl: params.searchByUrl,- searchByDescription: params.searchByDescription,- searchByTextContent: params.searchByTextContent,- searchByTags: params.searchByTags,} as LinkRequestQuery;const queryString = buildQueryString(queryParamsObject);diff --git a/lib/api/controllers/public/links/getPublicLinksUnderCollection.ts b/lib/api/controllers/public/links/getPublicLinksUnderCollection.tsindex 83431e3d..e6b8f9c6 100644--- a/lib/api/controllers/public/links/getPublicLinksUnderCollection.ts+++ b/lib/api/controllers/public/links/getPublicLinksUnderCollection.ts@@ -1,9 +1,7 @@import { prisma } from "@/lib/api/db";import { LinkRequestQuery, Order, Sort } from "@/types/global";-export default async function getLink(- query: Omit<LinkRequestQuery, "tagId" | "pinnedOnly">-) {+export default async function getLink(query: LinkRequestQuery) {const POSTGRES_IS_ENABLED =process.env.DATABASE_URL?.startsWith("postgresql");diff --git a/pages/api/v1/public/collections/links/index.ts b/pages/api/v1/public/collections/links/index.tsindex dd551790..993acdaa 100644--- a/pages/api/v1/public/collections/links/index.ts+++ b/pages/api/v1/public/collections/links/index.ts@@ -8,7 +8,7 @@ export default async function collections() {if (req.method === "GET") {// Convert the type of the request query to "LinkRequestQuery"- const convertedData: Omit<LinkRequestQuery, "tagId"> = {+ const convertedData: LinkRequestQuery = {sort: Number(req.query.sort as string),cursor: req.query.cursor ? Number(req.query.cursor as string) : undefined,collectionId: req.query.collectionId@@ -20,13 +20,6 @@ export default async function collections(searchQueryString: req.query.searchQueryString? (req.query.searchQueryString as string): undefined,- searchByName: req.query.searchByName === "true" ? true : undefined,- searchByUrl: req.query.searchByUrl === "true" ? true : undefined,- searchByDescription:- req.query.searchByDescription === "true" ? true : undefined,- searchByTextContent:- req.query.searchByTextContent === "true" ? true : undefined,- searchByTags: req.query.searchByTags === "true" ? true : undefined,};if (!convertedData.collectionId) {diff --git a/pages/api/v1/public/collections/tags/index.ts b/pages/api/v1/public/collections/tags/index.tsindex 9b8217d4..2a682ffe 100644--- a/pages/api/v1/public/collections/tags/index.ts+++ b/pages/api/v1/public/collections/tags/index.ts@@ -9,7 +9,7 @@ export default async function collections() {if (req.method === "GET") {// Convert the type of the request query to "LinkRequestQuery"- const convertedData: Omit<LinkRequestQuery, "tagId"> = {+ const convertedData: LinkRequestQuery = {sort: Number(req.query.sort as string),collectionId: req.query.collectionId? Number(req.query.collectionId as string)diff --git a/pages/api/v1/search/index.ts b/pages/api/v1/search/index.tsindex dde0bad0..9a59ee5f 100644--- a/pages/api/v1/search/index.ts+++ b/pages/api/v1/search/index.ts@@ -25,13 +25,6 @@ export default async function search(searchQueryString: req.query.searchQueryString? (req.query.searchQueryString as string): undefined,- searchByName: req.query.searchByName === "true" ? true : undefined,- searchByUrl: req.query.searchByUrl === "true" ? true : undefined,- searchByDescription:- req.query.searchByDescription === "true" ? true : undefined,- searchByTextContent:- req.query.searchByTextContent === "true" ? true : undefined,- searchByTags: req.query.searchByTags === "true" ? true : undefined,};const { statusCode, ...data } = await searchLinks(user.id, convertedData);diff --git a/types/global.ts b/types/global.tsindex 89341201..89fef70d 100644--- a/types/global.ts+++ b/types/global.ts@@ -94,11 +94,6 @@ export type LinkRequestQuery = {tagId?: number;pinnedOnly?: boolean;searchQueryString?: string;- searchByName?: boolean;- searchByUrl?: boolean;- searchByDescription?: boolean;- searchByTextContent?: boolean;- searchByTags?: boolean;};export type PublicLinkRequestQuery = {