This commit is contained in:
2019-01-04 21:27:45 +00:00
parent 713a788ffd
commit 5e13a107be
4 changed files with 3 additions and 50 deletions

View File

@@ -1,19 +0,0 @@
/* xeslint-disable */
import apiUtil from "./apiutil";
export default {
fetchAPIInfo() {
return new Promise(function(resolve, reject) {
//step 2: get it
fetch(apiUtil.APIUrl("ServerInfo"), apiUtil.fetchGetOptions())
.then(apiUtil.status)
.then(apiUtil.json)
.then(response => {
resolve(response);
})
.catch(function(error) {
reject(error);
});
});
}
};

View File

@@ -179,7 +179,6 @@ export default {
"API error: GET route =" + route + ", message =" + error.message;
store.commit("logItem", errorMessage);
alert("Error: " + errorMessage);
reject(error);
});
});

View File

@@ -1,27 +0,0 @@
/* xeslint-disable */
import apiUtil from "./apiutil";
import store from "../store";
export default {
get(route) {
return new Promise(function(resolve, reject) {
fetch(apiUtil.APIUrl(route), apiUtil.fetchGetOptions())
.then(apiUtil.status)
.then(apiUtil.json)
.then(response => {
//For now, assuming that all returns that make it here have either an error or a data object attached to them
//debugger;
resolve(response);
})
.catch(function(error) {
//fundamental error, can't proceed with this call
// debugger;
var errorMessage =
"API error: GET route =" + route + ", message =" + error.message;
store.commit("logItem", errorMessage);
alert("Error: " + errorMessage);
reject(error);
});
});
}
};

View File

@@ -103,7 +103,7 @@
<script>
/* xeslint-disable */
import apiMeta from "../api/apimeta";
import api from "../api/apiutil";
import aboutInfo from "../utils/aboutinfo";
import lt from "../api/locale";
export default {
@@ -135,8 +135,8 @@ export default {
},
mounted() {
this.clientInfo.version = aboutInfo.version;
apiMeta
.fetchAPIInfo()
api
.get("ServerInfo")
.then(response => {
this.serverInfo = response.data;
})