Skip to content

Commit

Permalink
send frontend source
Browse files Browse the repository at this point in the history
  • Loading branch information
Kractero committed Sep 1, 2024
1 parent b9f13f6 commit 7284576
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,21 @@
async function load() {
pageNum += 1
const inforeq = await fetch(`${PUBLIC_API_URL}/api/tradestotal?${queryString}`)
const inforeq = await fetch(`${PUBLIC_API_URL}/api/tradestotal?${queryString}`, {
headers: {
'X-Origin': 'frontend',
},
})
info = await inforeq.json()
foundCount = info.count
const req = await fetch(`${PUBLIC_API_URL}/api/trades-paginated?page=${pageNum}&${queryString}`)
const req = await fetch(
`${PUBLIC_API_URL}/api/trades-paginated?page=${pageNum}&${queryString}`,
{
headers: {
'X-Origin': 'frontend',
},
}
)
const newTrades = await req.json()
if (newTrades.length > 0) {
Expand Down Expand Up @@ -95,10 +106,18 @@
const baseURL = currentURL.split('?')[0]
pushState(`${baseURL}?${queryString}`, `${baseURL}?${queryString}`)
const num = await fetch(`${PUBLIC_API_URL}/api/tradestotal?${queryString}`)
const num = await fetch(`${PUBLIC_API_URL}/api/tradestotal?${queryString}`, {
headers: {
'X-Origin': 'frontend',
},
})
const count = await num.json()
foundCount = count.count
let tradesRes = await fetch(`${PUBLIC_API_URL}/api/trades-paginated?${queryString}`)
let tradesRes = await fetch(`${PUBLIC_API_URL}/api/trades-paginated?${queryString}`, {
headers: {
'X-Origin': 'frontend',
},
})
trades = await tradesRes.json()
}
Expand Down

0 comments on commit 7284576

Please sign in to comment.