mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Use fluid scale custom properties and make everything mobile friendly
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
import { API_BASE_PREFIX } from "$lib/utils";
|
||||
|
||||
export const load: PageServerLoad = async ({ fetch, cookies, url }) => {
|
||||
export const load: PageServerLoad = async ({ fetch, cookies, url, locals }) => {
|
||||
const searchQuery = url.searchParams.get("website_search_query");
|
||||
const sortBy = url.searchParams.get("website_sort");
|
||||
const filterBy = url.searchParams.get("website_filter");
|
||||
|
||||
const params = new URLSearchParams();
|
||||
|
||||
@@ -29,6 +30,15 @@ export const load: PageServerLoad = async ({ fetch, cookies, url }) => {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (filterBy) {
|
||||
case "creations":
|
||||
params.append("user_id", `eq.${locals.user.id}`);
|
||||
break;
|
||||
case "shared":
|
||||
params.append("user_id", `not.eq.${locals.user.id}`);
|
||||
break;
|
||||
}
|
||||
|
||||
const constructedFetchUrl = `${baseFetchUrl}?${params.toString()}`;
|
||||
|
||||
const totalWebsitesData = await fetch(baseFetchUrl, {
|
||||
|
||||
Reference in New Issue
Block a user