This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import aboutInfo from "./utils/aboutinfo";
|
||||
import aboutInfo from "./api/aboutinfo";
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
|
||||
@@ -160,7 +160,7 @@ export default {
|
||||
);
|
||||
},
|
||||
get(route) {
|
||||
var that=this;
|
||||
var that = this;
|
||||
//debugger;
|
||||
return new Promise(function(resolve, reject) {
|
||||
//debugger;
|
||||
@@ -169,12 +169,12 @@ export default {
|
||||
.then(that.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;
|
||||
// debugger;
|
||||
resolve(response);
|
||||
})
|
||||
.catch(function(error) {
|
||||
//fundamental error, can't proceed with this call
|
||||
// debugger;
|
||||
//debugger;
|
||||
var errorMessage =
|
||||
"API error: GET route =" + route + ", message =" + error.message;
|
||||
store.commit("logItem", errorMessage);
|
||||
@@ -183,4 +183,6 @@ export default {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//new functions above here
|
||||
};
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
/* xeslint-disable */
|
||||
import apiUtil from "./apiutil";
|
||||
export default {
|
||||
fetch(route, listOptions) {
|
||||
// listOptions;
|
||||
|
||||
// var futureWithSortExampleListOptions = {
|
||||
// offset: 5,
|
||||
// limit: 5,
|
||||
// sortBy: "name",
|
||||
// descending: false
|
||||
// };
|
||||
// exampleListOptions;
|
||||
|
||||
var listUrl = route + "?" + apiUtil.buildQuery(listOptions);
|
||||
|
||||
return new Promise(function(resolve, reject) {
|
||||
fetch(apiUtil.APIUrl(listUrl), apiUtil.fetchGetOptions())
|
||||
.then(apiUtil.status)
|
||||
.then(apiUtil.json)
|
||||
.then(response => {
|
||||
resolve(response);
|
||||
})
|
||||
.catch(function(error) {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -52,9 +52,9 @@
|
||||
|
||||
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
/* xeslint-disable */
|
||||
import localeText from "../api/locale";
|
||||
import pagedList from "../api/pagedlist";
|
||||
import api from "../api/apiutil";
|
||||
import WidgetEdit from "../components/inventorywidgetedit";
|
||||
export default {
|
||||
ltKeysRequired: [
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.rowsPerPageText = lt("RowsPerPage");
|
||||
this.rowsPerPageText = this.lt("RowsPerPage");
|
||||
this.getDataFromApi();
|
||||
},
|
||||
computed: {},
|
||||
@@ -136,7 +136,7 @@ export default {
|
||||
offset: 0,
|
||||
limit: 5,
|
||||
sort: "name",
|
||||
asc:true
|
||||
asc: true
|
||||
};
|
||||
|
||||
if (this.pagination.rowsPerPage && this.pagination.rowsPerPage > 0) {
|
||||
@@ -145,10 +145,12 @@ export default {
|
||||
listOptions.limit = this.pagination.rowsPerPage;
|
||||
}
|
||||
listOptions.sort = this.pagination.sortBy;
|
||||
listOptions.asc=!this.pagination.descending;
|
||||
listOptions.asc = !this.pagination.descending;
|
||||
|
||||
this.loading = true;
|
||||
pagedList.fetch("Widget/ListWidgets", listOptions).then(res => {
|
||||
//debugger;
|
||||
var listUrl = "Widget/ListWidgets?" + api.buildQuery(listOptions);
|
||||
api.get(listUrl).then(res => {
|
||||
// debugger;
|
||||
this.loading = false;
|
||||
this.Items = res.data;
|
||||
|
||||
@@ -92,7 +92,7 @@ export default function initialize() {
|
||||
//check the timezone offset is still valid, offer to change it if not
|
||||
//api.get("UserOptions/" + store.state.userId).then(res => {
|
||||
api
|
||||
.get("UserOptions/bb")
|
||||
.get("UserOptions/" + store.state.userId)
|
||||
.then(res => {
|
||||
if (res.error) {
|
||||
//In a form this would trigger a bunch of validation or error display code but for here and now:
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<script>
|
||||
/* xeslint-disable */
|
||||
import api from "../api/apiutil";
|
||||
import aboutInfo from "../utils/aboutinfo";
|
||||
import aboutInfo from "../api/aboutinfo";
|
||||
import lt from "../api/locale";
|
||||
export default {
|
||||
data() {
|
||||
|
||||
Reference in New Issue
Block a user