diff --git a/front/components/Recipes/AddRecipeModal.vue b/front/components/Recipes/AddRecipeModal.vue
index 3ed009d..56646ee 100644
--- a/front/components/Recipes/AddRecipeModal.vue
+++ b/front/components/Recipes/AddRecipeModal.vue
@@ -155,6 +155,7 @@
.then(() => {
this.$Message.success('Sukces!');
this.active = false;
+ this.$emit('recipe-added');
this.resetForm();
})
.catch(() => {
diff --git a/front/components/Recipes/SearchRecipe.vue b/front/components/Recipes/SearchRecipe.vue
index 0c3e9bd..1ceda16 100644
--- a/front/components/Recipes/SearchRecipe.vue
+++ b/front/components/Recipes/SearchRecipe.vue
@@ -8,7 +8,7 @@
Znalezione przepisy: {{ total }}
-
+
@@ -62,7 +62,7 @@
],
debounceTimer: 0,
page: 0,
- limit: 6,
+ limit: 10,
nextPage: true,
prevPage: false,
total: 0,
@@ -100,12 +100,13 @@
})
.then((response) => {
const data = response.data.data.recipes;
- this.recipes = this.recipes.concat(data.data);
+ this.recipes = data.data;
this.total = data.total;
this.nextPage = data.next_page_url != null;
this.prevPage = data.prev_page_url != null;
this.last_page = data.data.last_page;
this.current_page = data.current_page;
+ this.loading = false;
})
.catch((error) => {
console.log(error);
@@ -123,4 +124,4 @@
\ No newline at end of file
+
diff --git a/front/pages/recipes/index.vue b/front/pages/recipes/index.vue
index 605dffd..51213dc 100644
--- a/front/pages/recipes/index.vue
+++ b/front/pages/recipes/index.vue
@@ -1,10 +1,10 @@
@@ -19,6 +19,11 @@
components: {
AddRecipeModal,
SearchRecipe
+ },
+ methods: {
+ refreshRecipeTable(){
+ this.$refs.recipes.getRecipes();
+ }
}
};