Skip to content

Commit

Permalink
Sort by Trending to default (#1082)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
KingNish24 and nsarrazin authored Apr 29, 2024
1 parent e3ca107 commit fc53d26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/routes/assistants/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const load = async ({ url, locals }) => {
const pageIndex = parseInt(url.searchParams.get("p") ?? "0");
const username = url.searchParams.get("user");
const query = url.searchParams.get("q")?.trim() ?? null;
const sort = url.searchParams.get("sort")?.trim() ?? SortKey.POPULAR;
const sort = url.searchParams.get("sort")?.trim() ?? SortKey.TRENDING;
const createdByCurrentUser = locals.user?.username && locals.user.username === username;

let user: Pick<User, "_id"> | null = null;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/assistants/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@
on:change={sortAssistants}
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"
>
<option value={SortKey.POPULAR}>{SortKey.POPULAR}</option>
<option value={SortKey.TRENDING}>{SortKey.TRENDING}</option>
<option value={SortKey.POPULAR}>{SortKey.POPULAR}</option>
</select>
</div>

Expand Down

0 comments on commit fc53d26

Please sign in to comment.