Fixing env in the game page.

This commit is contained in:
Bradley Shellnut 2022-10-06 17:06:58 -05:00
parent 036c821cb0
commit 79e401a917
3 changed files with 140 additions and 139 deletions

View file

@ -8,7 +8,7 @@
(The data on the todo app will expire periodically; no (The data on the todo app will expire periodically; no
guarantees are made. Don't use it to organize your life.) guarantees are made. Don't use it to organize your life.)
*/ */
import { BOARD_GAME_ATLAS_CLIENT_ID } from '$env/static/private';
import { URLSearchParams } from 'url'; import { URLSearchParams } from 'url';
const base = 'https://api.boardgameatlas.com/api'; const base = 'https://api.boardgameatlas.com/api';
@ -20,7 +20,7 @@ export function boardGameApi(
data?: Record<string, unknown> data?: Record<string, unknown>
) { ) {
// console.log('queryParams', queryParams); // console.log('queryParams', queryParams);
queryParams.client_id = import.meta.env.VITE_PUBLIC_CLIENT_ID; queryParams.client_id = BOARD_GAME_ATLAS_CLIENT_ID;
const urlQueryParams = new URLSearchParams(queryParams); const urlQueryParams = new URLSearchParams(queryParams);
const url = `${base}/${resource}${urlQueryParams ? `?${urlQueryParams}` : ''}`; const url = `${base}/${resource}${urlQueryParams ? `?${urlQueryParams}` : ''}`;
return fetch(url, { return fetch(url, {

View file

@ -15,6 +15,7 @@ type GamePageParams = {
export const load: PageServerLoad = async ({ params }: GamePageParams) => { export const load: PageServerLoad = async ({ params }: GamePageParams) => {
console.log('params', params); console.log('params', params);
debugger;
const queryParams = { const queryParams = {
ids: `${params?.id}` ids: `${params?.id}`
}; };