ref: use relative urls

v0.4
rrr-marble 3 years ago
parent 5ad2cc89d4
commit 0196e92c3d

@ -62,15 +62,13 @@ export default {
"id"
],
itemPreview: {},
baseURL: "http://localhost:8080",
imageExtension: "bmp",
detailsLoaded: false,
};
},
methods: {
async fetchItemDetails() {
const baseURL = "http://localhost:8080/api/v1";
fetch(`${baseURL}/item/${this.$route.params.id}`)
fetch(`/api/v1/item/${this.$route.params.id}`)
.then(res => res.json())
.then(data => this.itemDetails = data)
.then(() => this.detailsLoaded = true)

@ -54,9 +54,7 @@ export default {
else {
item.active = false
}
})
console.log(route);
});
}
},
}

@ -51,18 +51,14 @@ export default {
},
methods: {
async fetchAllItems() {
const baseURL = "http://localhost:8080/api/v1";
fetch(`${baseURL}/items/?limit=10000`)
fetch(`/api/v1/items/?limit=10000`)
.then(res => res.json())
.then(data => this.items = data)
.catch((e) => console.log(e))
},
async fetchColumns(){
const baseURL = "http://localhost:8080/api/v1";
fetch(`${baseURL}/headers/`)
fetch(`/api/v1/headers/`)
.then(res => res.json())
.then(data => this.columns = data)
.catch((e) => console.log(e))

Loading…
Cancel
Save