This commit is contained in:
2020-09-08 23:43:57 +00:00
parent f70cb8907a
commit a8f2a1e51c
2 changed files with 15 additions and 9 deletions

View File

@@ -74,6 +74,9 @@ async function ayGetTranslations(keys) {
//
async function ayGetFromAPI(route, token) {
token = token || AYMETA.ayClientMetaData.Authorization;
if(route && !route.startsWith("http")){
route = AYMETA.ayServerMetaData.ayApiUrl + route;
}
try {
let r = await fetch(route, {
method: "get",
@@ -98,6 +101,9 @@ async function ayGetFromAPI(route, token) {
//
async function ayPostToAPI(route, data, token) {
token = token || AYMETA.ayClientMetaData.Authorization;
if(route && !route.startsWith("http")){
route = AYMETA.ayServerMetaData.ayApiUrl + route;
}
try {
fetchOptions = {
method: "post",