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.

missed a spot

Steven Teya0af17c25f13
diff --git a/components/app/links/link-filters/link-sort.tsx b/components/app/links/link-filters/link-sort.tsx
index 70f0ba8628..445177ea56 100644
--- a/components/app/links/link-filters/link-sort.tsx
+++ b/components/app/links/link-filters/link-sort.tsx
@@ -48,7 +48,7 @@ export default function LinkSort() {
}
const { slug: omit, ...finalQuery } = newQuery;
router.push({
- pathname: `/${router.query.slug}`,
+ pathname: `/${router.query.slug || "links"}`,
query: finalQuery,
});
}}
diff --git a/pages/api/links/index.ts b/pages/api/links/index.ts
index 8b830bb7cb..ee35f6030a 100644
--- a/pages/api/links/index.ts
+++ b/pages/api/links/index.ts
@@ -8,12 +8,14 @@ export default withUserAuth(
async (req: NextApiRequest, res: NextApiResponse, userId: string) => {
// GET /api/links – get all dub.sh links created by the user
if (req.method === "GET") {
- const { status } = req.query as {
+ const { status, sort } = req.query as {
status?: string;
+ sort?: "createdAt" | "clicks";
};
const response = await getLinksForProject({
domain: "dub.sh",
status,
+ sort,
userId,
});
return res.status(200).json(response);