aboutsummaryrefslogtreecommitdiff
path: root/src/components/user_settings
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-03-30 05:10:57 -0400
committertaehoon <th.dev91@gmail.com>2019-04-27 08:31:06 -0400
commit6d0e98a1c2c81c587b89736dbd2ac43a8c540d54 (patch)
tree33f10f421c9f6fafad4fe29a54621020e09484ab /src/components/user_settings
parent18bb209acefcdc332cba6708d9a0e163d0d04e90 (diff)
make Importer component reusable
Diffstat (limited to 'src/components/user_settings')
-rw-r--r--src/components/user_settings/user_settings.js8
-rw-r--r--src/components/user_settings/user_settings.vue2
2 files changed, 9 insertions, 1 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index a213650b..32e92dc4 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -234,6 +234,14 @@ const UserSettings = {
this.backgroundUploading = false
})
},
+ importFollows (file) {
+ return this.$store.state.api.backendInteractor.followImport(file)
+ .then((status) => {
+ if (!status) {
+ throw new Error('failed')
+ }
+ })
+ },
/* This function takes an Array of Users
* and outputs a file with all the addresses for the user to download
*/
diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue
index fb91e269..fc40bdc0 100644
--- a/src/components/user_settings/user_settings.vue
+++ b/src/components/user_settings/user_settings.vue
@@ -171,7 +171,7 @@
<div class="setting-item">
<h2>{{$t('settings.follow_import')}}</h2>
<p>{{$t('settings.import_followers_from_a_csv_file')}}</p>
- <Importer />
+ <Importer :submitHandler="importFollows" :successMessage="$t('settings.follows_imported')" :errorMessage="$t('settings.follow_import_error')" />
</div>
<div class="setting-item" v-if="enableFollowsExport">
<h2>{{$t('settings.follow_export')}}</h2>