Prepare tasks todo for fetching data on Photos page

This commit is contained in:
2021-10-05 23:41:11 +02:00
parent 012dba9a6b
commit 3679ac9432
2 changed files with 7 additions and 0 deletions

View File

@@ -1,6 +1,8 @@
# Options # Options
VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000 VITE_LIMIT_TIME=2 * 7 * 24 * 60 * 60 * 1000
VITE_PREVIEW_COUNT=4 VITE_PREVIEW_COUNT=4
VITE_GRID_AMOUNT=21
VITE_GRID_INCREMENT=21
# API related # API related
# VITE_API_URL_DEV="http://192.168.1.19:8055" # VITE_API_URL_DEV="http://192.168.1.19:8055"

View File

@@ -48,6 +48,7 @@
filterCountry = value filterCountry = value
// TODO: Request photos from the country of choice // TODO: Request photos from the country of choice
// TODO: Change URL query sort=value
} }
// Sort select // Sort select
@@ -57,6 +58,7 @@
filterSort = value filterSort = value
// TODO: Request photos sorted by the choice // TODO: Request photos sorted by the choice
// TODO: Change URL query sort=value
} }
@@ -68,6 +70,8 @@
filterCountry = defaultCountry filterCountry = defaultCountry
filterSort = defaultSort filterSort = defaultSort
// TODO: Change URL query sort=defaultSort and country=defaultCountry
}
/** /**
@@ -190,6 +194,7 @@
import { fetchAPI } from '$utils/api' import { fetchAPI } from '$utils/api'
export async function load ({ page, session, fetch, context }) { export async function load ({ page, session, fetch, context }) {
// TODO: Implement query parameters from URL (country, sort)
const res = await fetchAPI(` const res = await fetchAPI(`
query { query {
photo (limit: 11, sort: ["-date_created"]) { photo (limit: 11, sort: ["-date_created"]) {