mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Default search action plus adding back advanced search.
This commit is contained in:
parent
94c2b3fc93
commit
503b4d9e6d
6 changed files with 401 additions and 173 deletions
16
package.json
16
package.json
|
|
@ -19,24 +19,24 @@
|
|||
"@sveltejs/adapter-auto": "1.0.0-next.72",
|
||||
"@sveltejs/kit": "1.0.0-next.480",
|
||||
"@types/cookie": "^0.5.1",
|
||||
"@types/node": "^18.8.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.40.0",
|
||||
"@typescript-eslint/parser": "^5.40.0",
|
||||
"carbon-components-svelte": "^0.70.10",
|
||||
"carbon-icons-svelte": "^11.3.0",
|
||||
"eslint": "^8.25.0",
|
||||
"@types/node": "^18.11.5",
|
||||
"@typescript-eslint/eslint-plugin": "^5.41.0",
|
||||
"@typescript-eslint/parser": "^5.41.0",
|
||||
"carbon-components-svelte": "^0.70.12",
|
||||
"carbon-icons-svelte": "^11.4.0",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-svelte3": "^4.0.0",
|
||||
"just-debounce-it": "^3.1.1",
|
||||
"prettier": "^2.7.1",
|
||||
"prettier-plugin-svelte": "^2.8.0",
|
||||
"sass": "^1.55.0",
|
||||
"svelte": "^3.51.0",
|
||||
"svelte": "^3.52.0",
|
||||
"svelte-check": "^2.9.2",
|
||||
"svelte-preprocess": "^4.10.7",
|
||||
"tslib": "^2.0.0",
|
||||
"typescript": "^4.8.4",
|
||||
"vite": "^3.1.7"
|
||||
"vite": "^3.1.8"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
|
|
|
|||
244
pnpm-lock.yaml
244
pnpm-lock.yaml
|
|
@ -12,13 +12,13 @@ specifiers:
|
|||
'@sveltejs/kit': 1.0.0-next.480
|
||||
'@types/cookie': ^0.5.1
|
||||
'@types/feather-icons': ^4.7.0
|
||||
'@types/node': ^18.8.5
|
||||
'@typescript-eslint/eslint-plugin': ^5.40.0
|
||||
'@typescript-eslint/parser': ^5.40.0
|
||||
carbon-components-svelte: ^0.70.10
|
||||
carbon-icons-svelte: ^11.3.0
|
||||
'@types/node': ^18.11.5
|
||||
'@typescript-eslint/eslint-plugin': ^5.41.0
|
||||
'@typescript-eslint/parser': ^5.41.0
|
||||
carbon-components-svelte: ^0.70.12
|
||||
carbon-icons-svelte: ^11.4.0
|
||||
cookie: ^0.5.0
|
||||
eslint: ^8.25.0
|
||||
eslint: ^8.26.0
|
||||
eslint-config-prettier: ^8.1.0
|
||||
eslint-plugin-svelte3: ^4.0.0
|
||||
feather-icons: ^4.29.0
|
||||
|
|
@ -26,12 +26,12 @@ specifiers:
|
|||
prettier: ^2.7.1
|
||||
prettier-plugin-svelte: ^2.8.0
|
||||
sass: ^1.55.0
|
||||
svelte: ^3.51.0
|
||||
svelte: ^3.52.0
|
||||
svelte-check: ^2.9.2
|
||||
svelte-preprocess: ^4.10.7
|
||||
tslib: ^2.0.0
|
||||
typescript: ^4.8.4
|
||||
vite: ^3.1.7
|
||||
vite: ^3.1.8
|
||||
zod: ^3.19.1
|
||||
zod-to-json-schema: ^3.18.1
|
||||
|
||||
|
|
@ -48,29 +48,29 @@ dependencies:
|
|||
|
||||
devDependencies:
|
||||
'@playwright/test': 1.27.1
|
||||
'@rgossiaux/svelte-headlessui': 1.0.2_svelte@3.51.0
|
||||
'@rgossiaux/svelte-heroicons': 0.1.2_svelte@3.51.0
|
||||
'@rgossiaux/svelte-headlessui': 1.0.2_svelte@3.52.0
|
||||
'@rgossiaux/svelte-heroicons': 0.1.2_svelte@3.52.0
|
||||
'@sveltejs/adapter-auto': 1.0.0-next.72
|
||||
'@sveltejs/kit': 1.0.0-next.480_svelte@3.51.0+vite@3.1.7
|
||||
'@sveltejs/kit': 1.0.0-next.480_svelte@3.52.0+vite@3.1.8
|
||||
'@types/cookie': 0.5.1
|
||||
'@types/node': 18.8.5
|
||||
'@typescript-eslint/eslint-plugin': 5.40.0_25sstg4uu2sk4pm7xcyzuov7xq
|
||||
'@typescript-eslint/parser': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q
|
||||
carbon-components-svelte: 0.70.10
|
||||
carbon-icons-svelte: 11.3.0
|
||||
eslint: 8.25.0
|
||||
eslint-config-prettier: 8.5.0_eslint@8.25.0
|
||||
eslint-plugin-svelte3: 4.0.0_pr36k4f4yzzzfpayao7l7fkqni
|
||||
'@types/node': 18.11.5
|
||||
'@typescript-eslint/eslint-plugin': 5.41.0_huremdigmcnkianavgfk3x6iou
|
||||
'@typescript-eslint/parser': 5.41.0_wyqvi574yv7oiwfeinomdzmc3m
|
||||
carbon-components-svelte: 0.70.12
|
||||
carbon-icons-svelte: 11.4.0
|
||||
eslint: 8.26.0
|
||||
eslint-config-prettier: 8.5.0_eslint@8.26.0
|
||||
eslint-plugin-svelte3: 4.0.0_l6ppk7eerpslmlsqymzic46t24
|
||||
just-debounce-it: 3.1.1
|
||||
prettier: 2.7.1
|
||||
prettier-plugin-svelte: 2.8.0_ibge6ami6vq2q2j5g4rcvk62hq
|
||||
prettier-plugin-svelte: 2.8.0_lrllcp5xtrkmmdzifit4hd52ze
|
||||
sass: 1.55.0
|
||||
svelte: 3.51.0
|
||||
svelte-check: 2.9.2_sass@1.55.0+svelte@3.51.0
|
||||
svelte-preprocess: 4.10.7_3zdl52liprsvq5pqxbibodqiju
|
||||
svelte: 3.52.0
|
||||
svelte-check: 2.9.2_sass@1.55.0+svelte@3.52.0
|
||||
svelte-preprocess: 4.10.7_q7oepo4r57y5enzswpidbbgzsy
|
||||
tslib: 2.4.0
|
||||
typescript: 4.8.4
|
||||
vite: 3.1.7_sass@1.55.0
|
||||
vite: 3.1.8_sass@1.55.0
|
||||
|
||||
packages:
|
||||
|
||||
|
|
@ -126,8 +126,8 @@ packages:
|
|||
resolution: {integrity: sha512-bxUnRP8xptGRo8YXeY073DSpfK74XpSb0ZyRNpHV9WvLnJ7TwPOjZll8hTMin7zLC6iOp59pDZ8EQDj1gzgAQQ==}
|
||||
dev: false
|
||||
|
||||
/@humanwhocodes/config-array/0.10.5:
|
||||
resolution: {integrity: sha512-XVVDtp+dVvRxMoxSiSfasYaG02VEe1qH5cKgMQJWhol6HwzbcqoCMJi8dAGoYAO57jhUyhI6cWuRiTcRaDaYug==}
|
||||
/@humanwhocodes/config-array/0.11.6:
|
||||
resolution: {integrity: sha512-jJr+hPTJYKyDILJfhNSHsjiwXYf26Flsz8DvNndOsHs5pwSnpGUEy8yzF0JYhCEvTDdV2vuOK5tt8BVhwO5/hg==}
|
||||
engines: {node: '>=10.10.0'}
|
||||
dependencies:
|
||||
'@humanwhocodes/object-schema': 1.2.1
|
||||
|
|
@ -199,7 +199,7 @@ packages:
|
|||
nopt: 5.0.0
|
||||
npmlog: 5.0.1
|
||||
rimraf: 3.0.2
|
||||
semver: 7.3.7
|
||||
semver: 7.3.8
|
||||
tar: 6.1.11
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
|
|
@ -232,7 +232,7 @@ packages:
|
|||
engines: {node: '>=14'}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@types/node': 18.8.5
|
||||
'@types/node': 18.11.5
|
||||
playwright-core: 1.27.1
|
||||
dev: true
|
||||
|
||||
|
|
@ -240,20 +240,20 @@ packages:
|
|||
resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==}
|
||||
dev: true
|
||||
|
||||
/@rgossiaux/svelte-headlessui/1.0.2_svelte@3.51.0:
|
||||
/@rgossiaux/svelte-headlessui/1.0.2_svelte@3.52.0:
|
||||
resolution: {integrity: sha512-sauopYTSivhzXe1kAvgawkhyYJcQlK8Li3p0d2OtcCIVprOzdbard5lbqWB4xHDv83zAobt2mR08oizO2poHLQ==}
|
||||
peerDependencies:
|
||||
svelte: ^3.44.0
|
||||
dependencies:
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
dev: true
|
||||
|
||||
/@rgossiaux/svelte-heroicons/0.1.2_svelte@3.51.0:
|
||||
/@rgossiaux/svelte-heroicons/0.1.2_svelte@3.52.0:
|
||||
resolution: {integrity: sha512-c5Ep1QDvBo9HD/P0AxbXItDbn6x77fldCjjL0aBjNseUntV4fkdHkBde1IaLr8i0kmrhTSovjkIen8W83jUPzg==}
|
||||
peerDependencies:
|
||||
svelte: ^3.44.0
|
||||
dependencies:
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
dev: true
|
||||
|
||||
/@rollup/pluginutils/4.2.1:
|
||||
|
|
@ -302,7 +302,7 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@sveltejs/kit/1.0.0-next.480_svelte@3.51.0+vite@3.1.7:
|
||||
/@sveltejs/kit/1.0.0-next.480_svelte@3.52.0+vite@3.1.8:
|
||||
resolution: {integrity: sha512-RnltVDZFksAkeIZ0wgMQDr4POz3WZxSDy6D/ycIjrz3VXMDYWxKRqmTEI7Yl7TxPgUabeYHGRm/qI+nSXOb/Yw==}
|
||||
engines: {node: '>=16.14'}
|
||||
hasBin: true
|
||||
|
|
@ -311,7 +311,7 @@ packages:
|
|||
svelte: ^3.44.0
|
||||
vite: ^3.1.0
|
||||
dependencies:
|
||||
'@sveltejs/vite-plugin-svelte': 1.0.5_svelte@3.51.0+vite@3.1.7
|
||||
'@sveltejs/vite-plugin-svelte': 1.0.5_svelte@3.52.0+vite@3.1.8
|
||||
cookie: 0.5.0
|
||||
devalue: 3.1.3
|
||||
kleur: 4.1.5
|
||||
|
|
@ -321,16 +321,16 @@ packages:
|
|||
sade: 1.8.1
|
||||
set-cookie-parser: 2.5.1
|
||||
sirv: 2.0.2
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
tiny-glob: 0.2.9
|
||||
undici: 5.10.0
|
||||
vite: 3.1.7_sass@1.55.0
|
||||
vite: 3.1.8_sass@1.55.0
|
||||
transitivePeerDependencies:
|
||||
- diff-match-patch
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@sveltejs/vite-plugin-svelte/1.0.5_svelte@3.51.0+vite@3.1.7:
|
||||
/@sveltejs/vite-plugin-svelte/1.0.5_svelte@3.52.0+vite@3.1.8:
|
||||
resolution: {integrity: sha512-CmSdSow0Dr5ua1A11BQMtreWnE0JZmkVIcRU/yG3PKbycKUpXjNdgYTWFSbStLB0vdlGnBbm2+Y4sBVj+C+TIw==}
|
||||
engines: {node: ^14.18.0 || >= 16}
|
||||
peerDependencies:
|
||||
|
|
@ -346,9 +346,9 @@ packages:
|
|||
deepmerge: 4.2.2
|
||||
kleur: 4.1.5
|
||||
magic-string: 0.26.3
|
||||
svelte: 3.51.0
|
||||
svelte-hmr: 0.14.12_svelte@3.51.0
|
||||
vite: 3.1.7_sass@1.55.0
|
||||
svelte: 3.52.0
|
||||
svelte-hmr: 0.14.12_svelte@3.52.0
|
||||
vite: 3.1.8_sass@1.55.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
|
@ -365,8 +365,8 @@ packages:
|
|||
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
|
||||
dev: true
|
||||
|
||||
/@types/node/18.8.5:
|
||||
resolution: {integrity: sha512-Bq7G3AErwe5A/Zki5fdD3O6+0zDChhg671NfPjtIcbtzDNZTv4NPKMRFr7gtYPG7y+B8uTiNK4Ngd9T0FTar6Q==}
|
||||
/@types/node/18.11.5:
|
||||
resolution: {integrity: sha512-3JRwhbjI+cHLAkUorhf8RnqUbFXajvzX4q6fMn5JwkgtuwfYtRQYI3u4V92vI6NJuTsbBQWWh3RZjFsuevyMGQ==}
|
||||
dev: true
|
||||
|
||||
/@types/pug/2.0.6:
|
||||
|
|
@ -376,11 +376,15 @@ packages:
|
|||
/@types/sass/1.43.1:
|
||||
resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==}
|
||||
dependencies:
|
||||
'@types/node': 18.8.5
|
||||
'@types/node': 18.11.5
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/eslint-plugin/5.40.0_25sstg4uu2sk4pm7xcyzuov7xq:
|
||||
resolution: {integrity: sha512-FIBZgS3DVJgqPwJzvZTuH4HNsZhHMa9SjxTKAZTlMsPw/UzpEjcf9f4dfgDJEHjK+HboUJo123Eshl6niwEm/Q==}
|
||||
/@types/semver/7.3.12:
|
||||
resolution: {integrity: sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A==}
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/eslint-plugin/5.41.0_huremdigmcnkianavgfk3x6iou:
|
||||
resolution: {integrity: sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^5.0.0
|
||||
|
|
@ -390,12 +394,12 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@typescript-eslint/parser': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q
|
||||
'@typescript-eslint/scope-manager': 5.40.0
|
||||
'@typescript-eslint/type-utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q
|
||||
'@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q
|
||||
'@typescript-eslint/parser': 5.41.0_wyqvi574yv7oiwfeinomdzmc3m
|
||||
'@typescript-eslint/scope-manager': 5.41.0
|
||||
'@typescript-eslint/type-utils': 5.41.0_wyqvi574yv7oiwfeinomdzmc3m
|
||||
'@typescript-eslint/utils': 5.41.0_wyqvi574yv7oiwfeinomdzmc3m
|
||||
debug: 4.3.4
|
||||
eslint: 8.25.0
|
||||
eslint: 8.26.0
|
||||
ignore: 5.2.0
|
||||
regexpp: 3.2.0
|
||||
semver: 7.3.7
|
||||
|
|
@ -405,8 +409,8 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/parser/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q:
|
||||
resolution: {integrity: sha512-Ah5gqyX2ySkiuYeOIDg7ap51/b63QgWZA7w6AHtFrag7aH0lRQPbLzUjk0c9o5/KZ6JRkTTDKShL4AUrQa6/hw==}
|
||||
/@typescript-eslint/parser/5.41.0_wyqvi574yv7oiwfeinomdzmc3m:
|
||||
resolution: {integrity: sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
|
|
@ -415,26 +419,26 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 5.40.0
|
||||
'@typescript-eslint/types': 5.40.0
|
||||
'@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4
|
||||
'@typescript-eslint/scope-manager': 5.41.0
|
||||
'@typescript-eslint/types': 5.41.0
|
||||
'@typescript-eslint/typescript-estree': 5.41.0_typescript@4.8.4
|
||||
debug: 4.3.4
|
||||
eslint: 8.25.0
|
||||
eslint: 8.26.0
|
||||
typescript: 4.8.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/scope-manager/5.40.0:
|
||||
resolution: {integrity: sha512-d3nPmjUeZtEWRvyReMI4I1MwPGC63E8pDoHy0BnrYjnJgilBD3hv7XOiETKLY/zTwI7kCnBDf2vWTRUVpYw0Uw==}
|
||||
/@typescript-eslint/scope-manager/5.41.0:
|
||||
resolution: {integrity: sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 5.40.0
|
||||
'@typescript-eslint/visitor-keys': 5.40.0
|
||||
'@typescript-eslint/types': 5.41.0
|
||||
'@typescript-eslint/visitor-keys': 5.41.0
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/type-utils/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q:
|
||||
resolution: {integrity: sha512-nfuSdKEZY2TpnPz5covjJqav+g5qeBqwSHKBvz7Vm1SAfy93SwKk/JeSTymruDGItTwNijSsno5LhOHRS1pcfw==}
|
||||
/@typescript-eslint/type-utils/5.41.0_wyqvi574yv7oiwfeinomdzmc3m:
|
||||
resolution: {integrity: sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: '*'
|
||||
|
|
@ -443,23 +447,23 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4
|
||||
'@typescript-eslint/utils': 5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q
|
||||
'@typescript-eslint/typescript-estree': 5.41.0_typescript@4.8.4
|
||||
'@typescript-eslint/utils': 5.41.0_wyqvi574yv7oiwfeinomdzmc3m
|
||||
debug: 4.3.4
|
||||
eslint: 8.25.0
|
||||
eslint: 8.26.0
|
||||
tsutils: 3.21.0_typescript@4.8.4
|
||||
typescript: 4.8.4
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/types/5.40.0:
|
||||
resolution: {integrity: sha512-V1KdQRTXsYpf1Y1fXCeZ+uhjW48Niiw0VGt4V8yzuaDTU8Z1Xl7yQDyQNqyAFcVhpYXIVCEuxSIWTsLDpHgTbw==}
|
||||
/@typescript-eslint/types/5.41.0:
|
||||
resolution: {integrity: sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/typescript-estree/5.40.0_typescript@4.8.4:
|
||||
resolution: {integrity: sha512-b0GYlDj8TLTOqwX7EGbw2gL5EXS2CPEWhF9nGJiGmEcmlpNBjyHsTwbqpyIEPVpl6br4UcBOYlcI2FJVtJkYhg==}
|
||||
/@typescript-eslint/typescript-estree/5.41.0_typescript@4.8.4:
|
||||
resolution: {integrity: sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
typescript: '*'
|
||||
|
|
@ -467,8 +471,8 @@ packages:
|
|||
typescript:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 5.40.0
|
||||
'@typescript-eslint/visitor-keys': 5.40.0
|
||||
'@typescript-eslint/types': 5.41.0
|
||||
'@typescript-eslint/visitor-keys': 5.41.0
|
||||
debug: 4.3.4
|
||||
globby: 11.1.0
|
||||
is-glob: 4.0.3
|
||||
|
|
@ -479,30 +483,31 @@ packages:
|
|||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/utils/5.40.0_z4bbprzjrhnsfa24uvmcbu7f5q:
|
||||
resolution: {integrity: sha512-MO0y3T5BQ5+tkkuYZJBjePewsY+cQnfkYeRqS6tPh28niiIwPnQ1t59CSRcs1ZwJJNOdWw7rv9pF8aP58IMihA==}
|
||||
/@typescript-eslint/utils/5.41.0_wyqvi574yv7oiwfeinomdzmc3m:
|
||||
resolution: {integrity: sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
peerDependencies:
|
||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||
dependencies:
|
||||
'@types/json-schema': 7.0.11
|
||||
'@typescript-eslint/scope-manager': 5.40.0
|
||||
'@typescript-eslint/types': 5.40.0
|
||||
'@typescript-eslint/typescript-estree': 5.40.0_typescript@4.8.4
|
||||
eslint: 8.25.0
|
||||
'@types/semver': 7.3.12
|
||||
'@typescript-eslint/scope-manager': 5.41.0
|
||||
'@typescript-eslint/types': 5.41.0
|
||||
'@typescript-eslint/typescript-estree': 5.41.0_typescript@4.8.4
|
||||
eslint: 8.26.0
|
||||
eslint-scope: 5.1.1
|
||||
eslint-utils: 3.0.0_eslint@8.25.0
|
||||
eslint-utils: 3.0.0_eslint@8.26.0
|
||||
semver: 7.3.7
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
- typescript
|
||||
dev: true
|
||||
|
||||
/@typescript-eslint/visitor-keys/5.40.0:
|
||||
resolution: {integrity: sha512-ijJ+6yig+x9XplEpG2K6FUdJeQGGj/15U3S56W9IqXKJqleuD7zJ2AX/miLezwxpd7ZxDAqO87zWufKg+RPZyQ==}
|
||||
/@typescript-eslint/visitor-keys/5.41.0:
|
||||
resolution: {integrity: sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 5.40.0
|
||||
'@typescript-eslint/types': 5.41.0
|
||||
eslint-visitor-keys: 3.3.0
|
||||
dev: true
|
||||
|
||||
|
|
@ -645,14 +650,14 @@ packages:
|
|||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
/carbon-components-svelte/0.70.10:
|
||||
resolution: {integrity: sha512-JevvFOwmwyJTlop1UNiJ/bQ88PGFHipS8684qvHCMO283IxLmHaSydn5DcUIq9Qd1xV4qsQdCioYFI8DlLvc0Q==}
|
||||
/carbon-components-svelte/0.70.12:
|
||||
resolution: {integrity: sha512-CSVXWr53kSP/6ITaLxcCd/7rZStM3Mgl1tXedlwgvkViqDgCexWzSsK1u2RoSptmqL5IggUehabcETD6tm5EFg==}
|
||||
dependencies:
|
||||
flatpickr: 4.6.9
|
||||
dev: true
|
||||
|
||||
/carbon-icons-svelte/11.3.0:
|
||||
resolution: {integrity: sha512-45SHyp8RRwP5ZgV1YOvFIKPpdJDIrVzPL3f+YFK5V81eXr0MDH41vebKlRDAVMqAAetci8n8nRNGJ6JbBX2soQ==}
|
||||
/carbon-icons-svelte/11.4.0:
|
||||
resolution: {integrity: sha512-p/llZde2kP2BI9SOqM+QFKGfQnYrW+4dVxF1rAYriEADXDsjt9EYlh+KpQ5qf4JpXAq+e2+TB/r/lIG1xdUbAQ==}
|
||||
dev: true
|
||||
|
||||
/chalk/4.1.2:
|
||||
|
|
@ -1219,23 +1224,23 @@ packages:
|
|||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/eslint-config-prettier/8.5.0_eslint@8.25.0:
|
||||
/eslint-config-prettier/8.5.0_eslint@8.26.0:
|
||||
resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
eslint: '>=7.0.0'
|
||||
dependencies:
|
||||
eslint: 8.25.0
|
||||
eslint: 8.26.0
|
||||
dev: true
|
||||
|
||||
/eslint-plugin-svelte3/4.0.0_pr36k4f4yzzzfpayao7l7fkqni:
|
||||
/eslint-plugin-svelte3/4.0.0_l6ppk7eerpslmlsqymzic46t24:
|
||||
resolution: {integrity: sha512-OIx9lgaNzD02+MDFNLw0GEUbuovNcglg+wnd/UY0fbZmlQSz7GlQiQ1f+yX0XvC07XPcDOnFcichqI3xCwp71g==}
|
||||
peerDependencies:
|
||||
eslint: '>=8.0.0'
|
||||
svelte: ^3.2.0
|
||||
dependencies:
|
||||
eslint: 8.25.0
|
||||
svelte: 3.51.0
|
||||
eslint: 8.26.0
|
||||
svelte: 3.52.0
|
||||
dev: true
|
||||
|
||||
/eslint-scope/5.1.1:
|
||||
|
|
@ -1254,13 +1259,13 @@ packages:
|
|||
estraverse: 5.3.0
|
||||
dev: true
|
||||
|
||||
/eslint-utils/3.0.0_eslint@8.25.0:
|
||||
/eslint-utils/3.0.0_eslint@8.26.0:
|
||||
resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==}
|
||||
engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0}
|
||||
peerDependencies:
|
||||
eslint: '>=5'
|
||||
dependencies:
|
||||
eslint: 8.25.0
|
||||
eslint: 8.26.0
|
||||
eslint-visitor-keys: 2.1.0
|
||||
dev: true
|
||||
|
||||
|
|
@ -1274,14 +1279,15 @@ packages:
|
|||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
dev: true
|
||||
|
||||
/eslint/8.25.0:
|
||||
resolution: {integrity: sha512-DVlJOZ4Pn50zcKW5bYH7GQK/9MsoQG2d5eDH0ebEkE8PbgzTTmtt/VTH9GGJ4BfeZCpBLqFfvsjX35UacUL83A==}
|
||||
/eslint/8.26.0:
|
||||
resolution: {integrity: sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@eslint/eslintrc': 1.3.3
|
||||
'@humanwhocodes/config-array': 0.10.5
|
||||
'@humanwhocodes/config-array': 0.11.6
|
||||
'@humanwhocodes/module-importer': 1.0.1
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
ajv: 6.12.6
|
||||
chalk: 4.1.2
|
||||
cross-spawn: 7.0.3
|
||||
|
|
@ -1289,7 +1295,7 @@ packages:
|
|||
doctrine: 3.0.0
|
||||
escape-string-regexp: 4.0.0
|
||||
eslint-scope: 7.1.1
|
||||
eslint-utils: 3.0.0_eslint@8.25.0
|
||||
eslint-utils: 3.0.0_eslint@8.26.0
|
||||
eslint-visitor-keys: 3.3.0
|
||||
espree: 9.4.0
|
||||
esquery: 1.4.0
|
||||
|
|
@ -1299,12 +1305,12 @@ packages:
|
|||
find-up: 5.0.0
|
||||
glob-parent: 6.0.2
|
||||
globals: 13.17.0
|
||||
globby: 11.1.0
|
||||
grapheme-splitter: 1.0.4
|
||||
ignore: 5.2.0
|
||||
import-fresh: 3.3.0
|
||||
imurmurhash: 0.1.4
|
||||
is-glob: 4.0.3
|
||||
is-path-inside: 3.0.3
|
||||
js-sdsl: 4.1.4
|
||||
js-yaml: 4.1.0
|
||||
json-stable-stringify-without-jsonify: 1.0.1
|
||||
|
|
@ -1382,6 +1388,17 @@ packages:
|
|||
micromatch: 4.0.5
|
||||
dev: true
|
||||
|
||||
/fast-glob/3.2.12:
|
||||
resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
|
||||
engines: {node: '>=8.6.0'}
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.5
|
||||
dev: true
|
||||
|
||||
/fast-json-stable-stringify/2.1.0:
|
||||
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
|
||||
dev: true
|
||||
|
|
@ -1540,7 +1557,7 @@ packages:
|
|||
dependencies:
|
||||
array-union: 2.1.0
|
||||
dir-glob: 3.0.1
|
||||
fast-glob: 3.2.11
|
||||
fast-glob: 3.2.12
|
||||
ignore: 5.2.0
|
||||
merge2: 1.4.1
|
||||
slash: 3.0.0
|
||||
|
|
@ -1652,6 +1669,11 @@ packages:
|
|||
engines: {node: '>=0.12.0'}
|
||||
dev: true
|
||||
|
||||
/is-path-inside/3.0.3:
|
||||
resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==}
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/isexe/2.0.0:
|
||||
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
|
||||
dev: true
|
||||
|
|
@ -1970,14 +1992,14 @@ packages:
|
|||
engines: {node: '>= 0.8.0'}
|
||||
dev: true
|
||||
|
||||
/prettier-plugin-svelte/2.8.0_ibge6ami6vq2q2j5g4rcvk62hq:
|
||||
/prettier-plugin-svelte/2.8.0_lrllcp5xtrkmmdzifit4hd52ze:
|
||||
resolution: {integrity: sha512-QlXv/U3bUszks3XYDPsk1fsaQC+fo2lshwKbcbO+lrSVdJ+40mB1BfL8OCAk1W9y4pJxpqO/4gqm6NtF3zNGCw==}
|
||||
peerDependencies:
|
||||
prettier: ^1.16.4 || ^2.0.0
|
||||
svelte: ^3.2.0
|
||||
dependencies:
|
||||
prettier: 2.7.1
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
dev: true
|
||||
|
||||
/prettier/2.7.1:
|
||||
|
|
@ -2233,7 +2255,7 @@ packages:
|
|||
engines: {node: '>= 0.4'}
|
||||
dev: true
|
||||
|
||||
/svelte-check/2.9.2_sass@1.55.0+svelte@3.51.0:
|
||||
/svelte-check/2.9.2_sass@1.55.0+svelte@3.52.0:
|
||||
resolution: {integrity: sha512-DRi8HhnCiqiGR2YF9ervPGvtoYrheE09cXieCTEqeTPOTJzfoa54Py8rovIBv4bH4n5HgZYIyTQ3DDLHQLl2uQ==}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
|
|
@ -2245,8 +2267,8 @@ packages:
|
|||
import-fresh: 3.3.0
|
||||
picocolors: 1.0.0
|
||||
sade: 1.8.1
|
||||
svelte: 3.51.0
|
||||
svelte-preprocess: 4.10.7_3zdl52liprsvq5pqxbibodqiju
|
||||
svelte: 3.52.0
|
||||
svelte-preprocess: 4.10.7_q7oepo4r57y5enzswpidbbgzsy
|
||||
typescript: 4.8.4
|
||||
transitivePeerDependencies:
|
||||
- '@babel/core'
|
||||
|
|
@ -2261,16 +2283,16 @@ packages:
|
|||
- sugarss
|
||||
dev: true
|
||||
|
||||
/svelte-hmr/0.14.12_svelte@3.51.0:
|
||||
/svelte-hmr/0.14.12_svelte@3.52.0:
|
||||
resolution: {integrity: sha512-4QSW/VvXuqVcFZ+RhxiR8/newmwOCTlbYIezvkeN6302YFRE8cXy0naamHcjz8Y9Ce3ITTZtrHrIL0AGfyo61w==}
|
||||
engines: {node: ^12.20 || ^14.13.1 || >= 16}
|
||||
peerDependencies:
|
||||
svelte: '>=3.19.0'
|
||||
dependencies:
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
dev: true
|
||||
|
||||
/svelte-preprocess/4.10.7_3zdl52liprsvq5pqxbibodqiju:
|
||||
/svelte-preprocess/4.10.7_q7oepo4r57y5enzswpidbbgzsy:
|
||||
resolution: {integrity: sha512-sNPBnqYD6FnmdBrUmBCaqS00RyCsCpj2BG58A1JBswNF7b0OKviwxqVrOL/CKyJrLSClrSeqQv5BXNg2RUbPOw==}
|
||||
engines: {node: '>= 9.11.2'}
|
||||
requiresBuild: true
|
||||
|
|
@ -2318,12 +2340,12 @@ packages:
|
|||
sass: 1.55.0
|
||||
sorcery: 0.10.0
|
||||
strip-indent: 3.0.0
|
||||
svelte: 3.51.0
|
||||
svelte: 3.52.0
|
||||
typescript: 4.8.4
|
||||
dev: true
|
||||
|
||||
/svelte/3.51.0:
|
||||
resolution: {integrity: sha512-PBITYIrsNOuW+Dtds00gSY68raNZQn7i59Dg/fjgf6WwyawPKeBwle692coO7ILZqSO+UJe9899aDn9sMdeOHA==}
|
||||
/svelte/3.52.0:
|
||||
resolution: {integrity: sha512-FxcnEUOAVfr10vDU5dVgJN19IvqeHQCS1zfe8vayTfis9A2t5Fhx+JDe5uv/C3j//bB1umpLJ6quhgs9xyUbCQ==}
|
||||
engines: {node: '>= 8'}
|
||||
dev: true
|
||||
|
||||
|
|
@ -2417,8 +2439,8 @@ packages:
|
|||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: true
|
||||
|
||||
/vite/3.1.7_sass@1.55.0:
|
||||
resolution: {integrity: sha512-5vCAmU4S8lyVdFCInu9M54f/g8qbOMakVw5xJ4pjoaDy5wgy9sLLZkGdSLN52dlsBqh0tBqxjaqqa8LgPqwRAA==}
|
||||
/vite/3.1.8_sass@1.55.0:
|
||||
resolution: {integrity: sha512-m7jJe3nufUbuOfotkntGFupinL/fmuTNuQmiVE7cH2IZMuf4UbfbGYMUT3jVWgGYuRVLY9j8NnrRqgw5rr5QTg==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { enhance, applyAction } from '$app/forms';
|
||||
import type { PageData } from './$types';
|
||||
import type { ActionData, PageData } from './$types';
|
||||
import { ToastType, type GameType, type SavedGameType } from '$root/lib/types';
|
||||
import { toast } from '$root/lib/components/toast/toast';
|
||||
import { gameStore } from '$lib/stores/gameSearchStore';
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
import Pagination from '$lib/components/pagination/index.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
export let form: ActionData;
|
||||
console.log('Formed data:', JSON.stringify(data));
|
||||
let pageSize: number;
|
||||
let currentPage: number;
|
||||
|
|
@ -97,18 +98,21 @@
|
|||
boredState.update((n) => ({ ...n, loading: true }));
|
||||
return async ({ result }) => {
|
||||
boredState.update((n) => ({ ...n, loading: false }));
|
||||
console.log(result);
|
||||
console.log('result main page search', result);
|
||||
// `result` is an `ActionResult` object
|
||||
if (result.type === 'error') {
|
||||
toast.send('Error!', { duration: 3000, type: ToastType.ERROR, dismissible: true });
|
||||
await applyAction(result);
|
||||
} else {
|
||||
if (result.type === 'success') {
|
||||
console.log('In success');
|
||||
gameStore.removeAll();
|
||||
gameStore.addAll(result?.data?.games);
|
||||
const resultGames = result?.data?.games;
|
||||
if (resultGames?.length <= 0) {
|
||||
toast.send('No results!', { duration: 3000, type: ToastType.INFO, dismissible: true });
|
||||
}
|
||||
gameStore.addAll(resultGames);
|
||||
totalItems = result?.data?.totalCount;
|
||||
console.log(`Frontend result: ${JSON.stringify(result)}`);
|
||||
toast.send('Sucess!', { duration: 3000, type: ToastType.INFO, dismissible: true });
|
||||
await applyAction(result);
|
||||
} else {
|
||||
console.log('Invalid');
|
||||
}
|
||||
};
|
||||
}}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
import type { Actions, PageServerLoad } from '../$types';
|
||||
import { Games } from '$root/search/actions';
|
||||
import type { Actions, PageServerLoad, RequestEvent } from '../$types';
|
||||
import { BOARD_GAME_ATLAS_CLIENT_ID } from '$env/static/private';
|
||||
import { invalid } from '@sveltejs/kit';
|
||||
import type { GameType, SearchQuery } from '$root/lib/types';
|
||||
import { mapAPIGameToBoredGame } from '$root/lib/util/gameMapper';
|
||||
|
||||
export const load: PageServerLoad = (v) => {
|
||||
console.log('page server load request', v)
|
||||
|
|
@ -11,5 +14,202 @@ export const load: PageServerLoad = (v) => {
|
|||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
default: Games.search,
|
||||
}
|
||||
default: async ({ request, locals }: RequestEvent): Promise<any> => {
|
||||
console.log("In search action specific")
|
||||
// Do things in here
|
||||
const form = await request.formData();
|
||||
console.log('action form', form);
|
||||
const queryParams: SearchQuery = {
|
||||
order_by: 'rank',
|
||||
ascending: false,
|
||||
limit: 10,
|
||||
skip: 0,
|
||||
client_id: BOARD_GAME_ATLAS_CLIENT_ID,
|
||||
fuzzy_match: true,
|
||||
name: ''
|
||||
};
|
||||
|
||||
const minAge = form.get('minAge');
|
||||
const minPlayers = form.get('minPlayers');
|
||||
const maxPlayers = form.get('maxPlayers');
|
||||
const exactMinAge = form.get('exactMinAge') || false;
|
||||
const exactMinPlayers = form.get('exactMinPlayers') || false;
|
||||
const exactMaxPlayers = form.get('exactMaxPlayers') || false;
|
||||
|
||||
if (minAge) {
|
||||
if (exactMinAge) {
|
||||
queryParams.min_age = +minAge;
|
||||
} else {
|
||||
queryParams.gt_min_age = +minAge === 1 ? 0 : +minAge - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (minPlayers) {
|
||||
if (exactMinPlayers) {
|
||||
queryParams.min_players = +minPlayers;
|
||||
} else {
|
||||
queryParams.gt_min_players = +minPlayers === 1 ? 0 : +minPlayers - 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (maxPlayers) {
|
||||
if (exactMaxPlayers) {
|
||||
queryParams.max_players = +maxPlayers;
|
||||
} else {
|
||||
queryParams.lt_max_players = +maxPlayers + 1;
|
||||
}
|
||||
}
|
||||
|
||||
const name = form.has('name') ? form.get('name') : await request?.text();
|
||||
console.log('name', name);
|
||||
if (name) {
|
||||
queryParams.name = `${name}`;
|
||||
}
|
||||
|
||||
const newQueryParams: Record<string, string> = {};
|
||||
for (const key in queryParams) {
|
||||
console.log('key', key);
|
||||
console.log('queryParams[key]', queryParams[key as keyof SearchQuery]);
|
||||
newQueryParams[key] = `${queryParams[key as keyof SearchQuery]}`;
|
||||
}
|
||||
|
||||
const urlQueryParams = new URLSearchParams(newQueryParams);
|
||||
console.log('urlQueryParams', urlQueryParams);
|
||||
|
||||
try {
|
||||
const url = `https://api.boardgameatlas.com/api/search${urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
}`;
|
||||
const response = await fetch(url, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
});
|
||||
console.log('board game response', response);
|
||||
if (response.status !== 200) {
|
||||
console.log('Status not 200', response.status)
|
||||
invalid(response.status, {});
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
const gameResponse = await response.json();
|
||||
console.log('gameResponse', gameResponse);
|
||||
const gameList = gameResponse?.games;
|
||||
const totalCount = gameResponse?.count;
|
||||
console.log('totalCount', totalCount);
|
||||
const games: GameType[] = [];
|
||||
gameList.forEach((game) => {
|
||||
games.push(mapAPIGameToBoredGame(game));
|
||||
});
|
||||
|
||||
console.log('returning from search', games)
|
||||
|
||||
return {
|
||||
games,
|
||||
totalCount: games.length
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(`Error searching board games ${e}`);
|
||||
}
|
||||
return {
|
||||
games: [],
|
||||
totalCount: 0
|
||||
};
|
||||
}
|
||||
|
||||
// const id = form.get('id');
|
||||
// const ids = form.get('ids');
|
||||
// const minAge = form.get('minAge');
|
||||
// const minPlayers = form.get('minPlayers');
|
||||
// const maxPlayers = form.get('maxPlayers');
|
||||
// const exactMinAge = form.get('exactMinAge') || false;
|
||||
// const exactMinPlayers = form.get('exactMinPlayers') || false;
|
||||
// const exactMaxPlayers = form.get('exactMaxPlayers') || false;
|
||||
// const random = form.get('random') === 'on' || false;
|
||||
|
||||
// if (minAge) {
|
||||
// if (exactMinAge) {
|
||||
// queryParams.min_age = +minAge;
|
||||
// } else {
|
||||
// queryParams.gt_min_age = +minAge === 1 ? 0 : +minAge - 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (minPlayers) {
|
||||
// if (exactMinPlayers) {
|
||||
// queryParams.min_players = +minPlayers;
|
||||
// } else {
|
||||
// queryParams.gt_min_players = +minPlayers === 1 ? 0 : +minPlayers - 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (maxPlayers) {
|
||||
// if (exactMaxPlayers) {
|
||||
// queryParams.max_players = +maxPlayers;
|
||||
// } else {
|
||||
// queryParams.lt_max_players = +maxPlayers + 1;
|
||||
// }
|
||||
// }
|
||||
|
||||
// if (id) {
|
||||
// queryParams.ids = new Array(`${id}`);
|
||||
// }
|
||||
|
||||
// if (ids) {
|
||||
// // TODO: Pass in ids array from localstorage / game store
|
||||
// queryParams.ids = new Array(ids);
|
||||
// }
|
||||
|
||||
// queryParams.random = random;
|
||||
// console.log('queryParams', queryParams);
|
||||
|
||||
// const newQueryParams: Record<string, string> = {};
|
||||
// for (const key in queryParams) {
|
||||
// newQueryParams[key] = `${queryParams[key as keyof typeof queryParams]}`;
|
||||
// }
|
||||
|
||||
// const urlQueryParams = new URLSearchParams(newQueryParams);
|
||||
|
||||
// const url = `https://api.boardgameatlas.com/api/search${urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
// }`;
|
||||
// const response = await fetch(url, {
|
||||
// method: 'get',
|
||||
// headers: {
|
||||
// 'content-type': 'application/json'
|
||||
// }
|
||||
// });
|
||||
// console.log('response status', response.status);
|
||||
// console.log('board game response action', response);
|
||||
// if (response.status === 404) {
|
||||
// // user hasn't created a todo list.
|
||||
// // start with an empty array
|
||||
// return {
|
||||
// success: true,
|
||||
// games: [],
|
||||
// totalCount: 0
|
||||
// };
|
||||
// }
|
||||
|
||||
// if (response.status === 200) {
|
||||
// const gameResponse = await response.json();
|
||||
// console.log('gameResponse', gameResponse);
|
||||
// const gameList = gameResponse?.games;
|
||||
// const games: GameType[] = [];
|
||||
// gameList.forEach((game: GameType) => {
|
||||
// games.push(mapAPIGameToBoredGame(game));
|
||||
// });
|
||||
// console.log('action games', games);
|
||||
// return {
|
||||
// games,
|
||||
// totalCount: games.length
|
||||
// };
|
||||
// }
|
||||
|
||||
// return { success: false };
|
||||
// }
|
||||
// create: async function create({ request, locals }): Promise<any> {
|
||||
// const data = await getFormDataObject<any>(request);
|
||||
// return data;
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
<div class="game-search">
|
||||
<form
|
||||
action="/search"
|
||||
action="?/search"
|
||||
method="post"
|
||||
use:enhance={() => {
|
||||
boredState.update((n) => ({ ...n, loading: true }));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { RequestEvent } from '@sveltejs/kit';
|
||||
import { invalid, type RequestEvent } from '@sveltejs/kit';
|
||||
import { BOARD_GAME_ATLAS_CLIENT_ID } from '$env/static/private';
|
||||
import type { GameType, SearchQuery } from "$root/lib/types";
|
||||
import { mapAPIGameToBoredGame } from "$root/lib/util/gameMapper";
|
||||
|
|
@ -39,47 +39,49 @@ export const Games: Actions = {
|
|||
const urlQueryParams = new URLSearchParams(newQueryParams);
|
||||
console.log('urlQueryParams', urlQueryParams);
|
||||
|
||||
const url = `https://api.boardgameatlas.com/api/search${urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
}`;
|
||||
const response = await fetch(url, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
});
|
||||
console.log('board game response', response);
|
||||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
return {
|
||||
games: [],
|
||||
totalCount: 0
|
||||
};
|
||||
try {
|
||||
throw new Error("test error");
|
||||
// const url = `https://api.boardgameatlas.com/api/search${urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
// }`;
|
||||
// const response = await fetch(url, {
|
||||
// method: 'get',
|
||||
// headers: {
|
||||
// 'content-type': 'application/json'
|
||||
// }
|
||||
// });
|
||||
// console.log('board game response', response);
|
||||
// if (response.status !== 200) {
|
||||
// console.log('Status not 200', response.status)
|
||||
// invalid(response.status, {});
|
||||
// }
|
||||
|
||||
// if (response.status === 200) {
|
||||
// const gameResponse = await response.json();
|
||||
// console.log('gameResponse', gameResponse);
|
||||
// const gameList = gameResponse?.games;
|
||||
// const totalCount = gameResponse?.count;
|
||||
// console.log('totalCount', totalCount);
|
||||
// const games: GameType[] = [];
|
||||
// gameList.forEach((game) => {
|
||||
// games.push(mapAPIGameToBoredGame(game));
|
||||
// });
|
||||
|
||||
// console.log('returning from search')
|
||||
|
||||
// return {
|
||||
// games,
|
||||
// totalCount: games.length
|
||||
// };
|
||||
// }
|
||||
|
||||
// return {
|
||||
// games: [],
|
||||
// totalCount: 0
|
||||
// };
|
||||
} catch (e) {
|
||||
console.log(`Error searching board games ${e}`);
|
||||
invalid(400, { reason: 'Exception' })
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
const gameResponse = await response.json();
|
||||
console.log('gameResponse', gameResponse);
|
||||
const gameList = gameResponse?.games;
|
||||
const totalCount = gameResponse?.count;
|
||||
console.log('totalCount', totalCount);
|
||||
const games: GameType[] = [];
|
||||
gameList.forEach((game) => {
|
||||
games.push(mapAPIGameToBoredGame(game));
|
||||
});
|
||||
|
||||
console.log('returning from search')
|
||||
|
||||
return {
|
||||
games,
|
||||
totalCount: games.length
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
games: [],
|
||||
totalCount: 0
|
||||
};
|
||||
}
|
||||
|
||||
// const id = form.get('id');
|
||||
|
|
|
|||
Loading…
Reference in a new issue