diff --git a/src/components/ImageList.vue b/src/components/ImageList.vue index e674615241ac0a06d335875eeff0b688522f96ef..2be51a24b22aa9a7e6cd9012bfc2ada75f59a3d7 100644 --- a/src/components/ImageList.vue +++ b/src/components/ImageList.vue @@ -33,6 +33,7 @@ import ImageItem from "@/components/ImageItem.vue"; import PaginationBar from "@/components/PaginationBar.vue"; import { mapState, mapActions } from "vuex"; +import paths from "@/assets/js/paths.js"; export default { components: { @@ -62,12 +63,12 @@ export default { this.setStateImageSnowflakes(await this.getSnowflakes(this.currentPage)); }, async getSnowflakes(pageEntry) { - const response = await fetch(`/api/image/page/${pageEntry}/`); + const response = await fetch(paths.ImagePageField(pageEntry)); const snowflakes = await response.json(); return snowflakes; }, async getLastPage() { - const response = await fetch("/api/image/page"); + const response = await fetch(paths.ImagePage); const lastPage = await response.text(); return lastPage; }, @@ -83,7 +84,7 @@ export default { headers: { secret: this.stateUser.secret }, }; for (let i = 0; i < deleteArray.length; i++) { - fetch(`/api/image/${deleteArray[i]}`, options); + fetch(paths.ImageField(deleteArray[i]), options); } this.deleteArray = []; },