Skip to content
Snippets Groups Projects
Commit ef2a1730 authored by Trirst's avatar Trirst
Browse files

Set new appropriate API endpoints in ImageList

parent a5715568
No related branches found
No related tags found
No related merge requests found
......@@ -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 = [];
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment