diff options
| author | AAGaming <aa@mail.catvibers.me> | 2022-06-29 12:17:25 -0400 |
|---|---|---|
| committer | AAGaming <aa@mail.catvibers.me> | 2022-06-29 12:17:25 -0400 |
| commit | 79e8af8be66a27835611dec062bf85cac7b09468 (patch) | |
| tree | d4691c8269ab31a2507d4887026ee84537724c43 /frontend/src/components/store/Store.tsx | |
| parent | 18d444e8fc04da818250b36212540065693d3fa2 (diff) | |
| download | decky-loader-79e8af8be66a27835611dec062bf85cac7b09468.tar.gz decky-loader-79e8af8be66a27835611dec062bf85cac7b09468.zip | |
update store for new format, awaiting cors to test
Diffstat (limited to 'frontend/src/components/store/Store.tsx')
| -rw-r--r-- | frontend/src/components/store/Store.tsx | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/frontend/src/components/store/Store.tsx b/frontend/src/components/store/Store.tsx index 0e99a3c2..4890cb9d 100644 --- a/frontend/src/components/store/Store.tsx +++ b/frontend/src/components/store/Store.tsx @@ -3,11 +3,15 @@ import { FC, useEffect, useState } from 'react'; import PluginCard from './PluginCard'; +export interface StorePluginVersion { + name: string; + hash: string; +} + export interface StorePlugin { - artifact: string; - versions: { - [version: string]: string; - }; + id: number; + name: string; + versions: StorePluginVersion[]; author: string; description: string; tags: string[]; @@ -22,11 +26,11 @@ export async function installFromURL(url: string) { }); } -export async function requestPluginInstall(plugin: StorePlugin, selectedVer: string) { +export async function requestPluginInstall(plugin: StorePlugin, selectedVer: StorePluginVersion) { const formData = new FormData(); - formData.append('artifact', `https://github.com/${plugin.artifact}/archive/refs/tags/${selectedVer}.zip`); - formData.append('version', selectedVer); - formData.append('hash', plugin.versions[selectedVer]); + formData.append('artifact', `https://cdn.tzatzikiweeb.moe/file/steam-deck-homebrew/versions/${selectedVer.hash}.zip`); + formData.append('version', selectedVer.name); + formData.append('hash', selectedVer.hash); await fetch('http://localhost:1337/browser/install_plugin', { method: 'POST', body: formData, @@ -38,7 +42,7 @@ const StorePage: FC<{}> = () => { useEffect(() => { (async () => { - const res = await fetch('https://beta.deckbrew.xyz/get_plugins', { method: 'GET' }).then((r) => r.json()); + const res = await fetch('https://beta.deckbrew.xyz/plugins', { method: 'GET' }).then((r) => r.json()); console.log(res); setData(res); })(); |
