Skip to content

Commit fc53d26

Browse files
Sort by Trending to default (#1082)
* Sort by Trending to default Switched the default sorting from 'popular' to 'trending'. * Set TRENDING as the default sort key in load function --------- Co-authored-by: Nathan Sarrazin <sarrazin.nathan@gmail.com>
1 parent e3ca107 commit fc53d26

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/routes/assistants/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const load = async ({ url, locals }) => {
1818
const pageIndex = parseInt(url.searchParams.get("p") ?? "0");
1919
const username = url.searchParams.get("user");
2020
const query = url.searchParams.get("q")?.trim() ?? null;
21-
const sort = url.searchParams.get("sort")?.trim() ?? SortKey.POPULAR;
21+
const sort = url.searchParams.get("sort")?.trim() ?? SortKey.TRENDING;
2222
const createdByCurrentUser = locals.user?.username && locals.user.username === username;
2323

2424
let user: Pick<User, "_id"> | null = null;

src/routes/assistants/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@
213213
on:change={sortAssistants}
214214
class="rounded-lg border border-gray-300 bg-gray-50 px-2 py-1 text-sm text-gray-900 focus:border-blue-700 focus:ring-blue-700 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400"
215215
>
216-
<option value={SortKey.POPULAR}>{SortKey.POPULAR}</option>
217216
<option value={SortKey.TRENDING}>{SortKey.TRENDING}</option>
217+
<option value={SortKey.POPULAR}>{SortKey.POPULAR}</option>
218218
</select>
219219
</div>
220220

0 commit comments

Comments
 (0)