From e0b6ffd62be573d29581dcff5b4dbc0f31ac82a5 Mon Sep 17 00:00:00 2001
From: MinerAle <66887063+MinerAle00@users.noreply.github.com>
Date: Sun, 2 Mar 2025 21:45:43 +0100
Subject: [PATCH 1/4] feat: Add sorting options for links in dashboard
---
components/dashboard/links/Index.vue | 36 ++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/components/dashboard/links/Index.vue b/components/dashboard/links/Index.vue
index b0a56eb..58c297b 100644
--- a/components/dashboard/links/Index.vue
+++ b/components/dashboard/links/Index.vue
@@ -7,6 +7,7 @@ const limit = 24
let cursor = ''
let listComplete = false
let listError = false
+const sortBy = ref('created_desc') // created_desc, created_asc, alpha_asc, alpha_desc
async function getLinks() {
try {
@@ -14,6 +15,7 @@ async function getLinks() {
query: {
limit,
cursor,
+ sort: sortBy.value,
},
})
links.value = links.value.concat(data.links).filter(Boolean) // Sometimes cloudflare will return null, filter out
@@ -62,6 +64,40 @@ function updateLinkList(link, type) {