This commit is contained in:
19
app/ayanova/src/api/apimeta.js
Normal file
19
app/ayanova/src/api/apimeta.js
Normal file
@@ -0,0 +1,19 @@
|
||||
/* xeslint-disable */
|
||||
import apiUtil from "./apiutil";
|
||||
|
||||
export default {
|
||||
fetchAPIInfo() {
|
||||
return new Promise(function(resolve, reject) {
|
||||
//step 2: get it
|
||||
fetch(apiUtil.APIUrl("ServerInfo"), apiUtil.fetch())
|
||||
.then(apiUtil.status)
|
||||
.then(apiUtil.json)
|
||||
.then(response => {
|
||||
resolve(response);
|
||||
})
|
||||
.catch(function(error) {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -51,6 +51,14 @@ export default {
|
||||
body: JSON.stringify(data)
|
||||
};
|
||||
},
|
||||
fetch() {
|
||||
/* GET WITH AUTH */
|
||||
return {
|
||||
method: "get",
|
||||
mode: "cors",
|
||||
headers: this.postAuthorizedHeaders()
|
||||
};
|
||||
},
|
||||
APIUrl(apiPath) {
|
||||
if ("" == store.state.apiUrl) {
|
||||
//construct the api url and store it
|
||||
|
||||
Reference in New Issue
Block a user