2019-03-30 12:58:20 +11:00
|
|
|
const Importer = {
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
file: null,
|
|
|
|
error: false,
|
|
|
|
success: false,
|
|
|
|
uploading: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
change () {
|
|
|
|
this.file = this.$refs.input.files[0]
|
|
|
|
},
|
|
|
|
submit () {
|
|
|
|
this.uploading = true
|
2019-03-30 14:39:24 +11:00
|
|
|
this.$store.state.api.backendInteractor.followImport(this.file)
|
2019-03-30 12:58:20 +11:00
|
|
|
.then((status) => {
|
|
|
|
if (status) {
|
|
|
|
this.success = true
|
|
|
|
} else {
|
|
|
|
this.error = true
|
|
|
|
}
|
|
|
|
this.uploading = false
|
|
|
|
})
|
|
|
|
},
|
|
|
|
dismiss () {
|
|
|
|
this.success = false
|
|
|
|
this.error = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Importer
|