This commit is contained in:
2019-01-04 21:45:46 +00:00
parent 5e13a107be
commit c86dd91d33
7 changed files with 16 additions and 41 deletions

View File

@@ -47,7 +47,7 @@
</template> </template>
<script> <script>
import aboutInfo from "./utils/aboutinfo"; import aboutInfo from "./api/aboutinfo";
export default { export default {
name: "App", name: "App",

View File

@@ -183,4 +183,6 @@ export default {
}); });
}); });
} }
//new functions above here
}; };

View File

@@ -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);
});
});
}
};

View File

@@ -52,9 +52,9 @@
<script> <script>
/* eslint-disable */ /* xeslint-disable */
import localeText from "../api/locale"; import localeText from "../api/locale";
import pagedList from "../api/pagedlist"; import api from "../api/apiutil";
import WidgetEdit from "../components/inventorywidgetedit"; import WidgetEdit from "../components/inventorywidgetedit";
export default { export default {
ltKeysRequired: [ ltKeysRequired: [
@@ -118,7 +118,7 @@ export default {
} }
}, },
mounted() { mounted() {
this.rowsPerPageText = lt("RowsPerPage"); this.rowsPerPageText = this.lt("RowsPerPage");
this.getDataFromApi(); this.getDataFromApi();
}, },
computed: {}, computed: {},
@@ -148,7 +148,9 @@ export default {
listOptions.asc = !this.pagination.descending; listOptions.asc = !this.pagination.descending;
this.loading = true; this.loading = true;
pagedList.fetch("Widget/ListWidgets", listOptions).then(res => { //debugger;
var listUrl = "Widget/ListWidgets?" + api.buildQuery(listOptions);
api.get(listUrl).then(res => {
// debugger; // debugger;
this.loading = false; this.loading = false;
this.Items = res.data; this.Items = res.data;

View File

@@ -92,7 +92,7 @@ export default function initialize() {
//check the timezone offset is still valid, offer to change it if not //check the timezone offset is still valid, offer to change it if not
//api.get("UserOptions/" + store.state.userId).then(res => { //api.get("UserOptions/" + store.state.userId).then(res => {
api api
.get("UserOptions/bb") .get("UserOptions/" + store.state.userId)
.then(res => { .then(res => {
if (res.error) { if (res.error) {
//In a form this would trigger a bunch of validation or error display code but for here and now: //In a form this would trigger a bunch of validation or error display code but for here and now:

View File

@@ -104,7 +104,7 @@
<script> <script>
/* xeslint-disable */ /* xeslint-disable */
import api from "../api/apiutil"; import api from "../api/apiutil";
import aboutInfo from "../utils/aboutinfo"; import aboutInfo from "../api/aboutinfo";
import lt from "../api/locale"; import lt from "../api/locale";
export default { export default {
data() { data() {