mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 23:21:57 +00:00
fix oops
This commit is contained in:
@@ -118,6 +118,19 @@ class PluginLoader extends Logger {
|
|||||||
return {
|
return {
|
||||||
routerHook: this.routerHook,
|
routerHook: this.routerHook,
|
||||||
callServerMethod: this.callServerMethod,
|
callServerMethod: this.callServerMethod,
|
||||||
|
async callPluginMethod(methodName: string, args = {}) {
|
||||||
|
const response = await fetch(`http://127.0.0.1:1337/plugins/${pluginName}/methods/${methodName}`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
args,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
|
return response.json();
|
||||||
|
},
|
||||||
fetchNoCors(url: string, request: any = {}) {
|
fetchNoCors(url: string, request: any = {}) {
|
||||||
let args = { method: 'POST', headers: {}, body: '' };
|
let args = { method: 'POST', headers: {}, body: '' };
|
||||||
const req = { ...args, ...request, url, data: request.body };
|
const req = { ...args, ...request, url, data: request.body };
|
||||||
|
|||||||
Reference in New Issue
Block a user