diff --git a/resources/js/processes/categories/components/CategoriesListing.vue b/resources/js/processes/categories/components/CategoriesListing.vue index 40bb754e83..85107bde63 100644 --- a/resources/js/processes/categories/components/CategoriesListing.vue +++ b/resources/js/processes/categories/components/CategoriesListing.vue @@ -116,6 +116,7 @@ props: ["filter", "permissions", "apiRoute", "include", "labelCount", "count", "loadOnStart"], data () { return { + fetchFlag: 0, localLoadOnStart: !!this.loadOnStart, orderBy: "name", sortOrder: [ @@ -235,6 +236,13 @@ "&include=" + this.include ) .then(response => { + if (response.data.data.length === 0 && this.fetchFlag === 0){ + this.page = 1; + this.fetch(); + this.fetchFlag = 1; + } else { + this.fetchFlag = 0; + } if (response.data.data.length === 0 && !this.filter) { $("#createCategory") .modal("show");