Cache API
This commit is contained in:
@@ -14,19 +14,11 @@ export async function close(cid) {
|
||||
})).json();
|
||||
}
|
||||
|
||||
export async function call(cid, method, ...params) {
|
||||
export async function call(cid, body) {
|
||||
return await (await fetch('/v1/vista/' + cid, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ method: method, params: params, id: Date.now() })
|
||||
})).json();
|
||||
}
|
||||
|
||||
export async function callctx(cid, context, method, ...params) {
|
||||
return await (await fetch('/v1/vista/' + cid, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ method: method, params: params, context: context, id: Date.now() })
|
||||
body: JSON.stringify(body)
|
||||
})).json();
|
||||
}
|
||||
|
||||
@@ -55,5 +47,5 @@ export async function authenticate(cid, avcode=null) {
|
||||
}
|
||||
|
||||
export default window.vista = {
|
||||
connect, close, call, callctx, serverinfo, userinfo, authenticate
|
||||
connect, close, call, serverinfo, userinfo, authenticate
|
||||
};
|
||||
|
Reference in New Issue
Block a user