ref: use relative urls

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

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

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

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

Loading…
Cancel
Save