From 8669199b1aa23812596c476a9eb8620a09938a43 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Wed, 15 Mar 2023 00:08:20 +0100 Subject: [PATCH] Add button to export members --- app/Member/Actions/ExportAction.php | 8 ++++---- resources/js/mixins/indexHelpers.js | 8 ++++++-- resources/js/views/member/VIndex.vue | 9 ++++++++- tests/Feature/Member/ExportCsvActionTest.php | 3 ++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/Member/Actions/ExportAction.php b/app/Member/Actions/ExportAction.php index 69b7b691..89ba0e62 100644 --- a/app/Member/Actions/ExportAction.php +++ b/app/Member/Actions/ExportAction.php @@ -16,7 +16,7 @@ class ExportAction use AsAction; /** - * @param Collection + * @param Collection $members */ public function handle(Collection $members): string { @@ -31,9 +31,9 @@ class ExportAction $member->address, $member->zip, $member->location, - $member->mainPhone, - $member->mobilePhone, - $member->workPhone, + $member->main_phone, + $member->mobile_phone, + $member->work_phone, ]); } diff --git a/resources/js/mixins/indexHelpers.js b/resources/js/mixins/indexHelpers.js index 95d88e36..8da5f9b4 100644 --- a/resources/js/mixins/indexHelpers.js +++ b/resources/js/mixins/indexHelpers.js @@ -7,11 +7,16 @@ export default { props: { data: {}, }, + computed: { + filterString() { + return btoa(JSON.stringify(this.inner.meta.filter)); + }, + }, methods: { reload(resetPage = true) { var _self = this; var data = { - filter: btoa(JSON.stringify(this.inner.meta.filter)), + filter: this.filterString, page: 1, }; @@ -50,4 +55,3 @@ export default { }, }, }; - diff --git a/resources/js/views/member/VIndex.vue b/resources/js/views/member/VIndex.vue index 19309fa2..ed08a434 100644 --- a/resources/js/views/member/VIndex.vue +++ b/resources/js/views/member/VIndex.vue @@ -1,6 +1,6 @@