Finish home
This commit is contained in:
parent
f6f98a7003
commit
0f1ea1f5d0
@ -9,19 +9,31 @@
|
||||
height="20">
|
||||
<Alert v-if="failed" />
|
||||
</template>
|
||||
<template #actions>
|
||||
<NcActionButton @click="deleteSubscription">
|
||||
<template #icon>
|
||||
<Delete :size="20" />
|
||||
</template>
|
||||
{{ t('Delete') }}
|
||||
</NcActionButton>
|
||||
</template>
|
||||
</NcAppNavigationItem>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { NcActionButton, NcAppNavigationItem } from '@nextcloud/vue'
|
||||
import Alert from 'vue-material-design-icons/Alert.vue'
|
||||
import { NcAppNavigationItem } from '@nextcloud/vue'
|
||||
import Delete from 'vue-material-design-icons/Delete.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
import { generateUrl } from '@nextcloud/router'
|
||||
import { showError } from '@nextcloud/dialogs'
|
||||
|
||||
export default {
|
||||
name: 'SubscriptionListItem',
|
||||
components: {
|
||||
Alert,
|
||||
Delete,
|
||||
NcActionButton,
|
||||
NcAppNavigationItem,
|
||||
},
|
||||
props: {
|
||||
@ -50,5 +62,21 @@ export default {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async deleteSubscription() {
|
||||
this.loading = true
|
||||
|
||||
try {
|
||||
await axios.post(generateUrl('/apps/gpoddersync/subscription_change/create'), { add: [], remove: [this.subscriptionUrl] })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
showError(t('Error while removing the feed'))
|
||||
}
|
||||
|
||||
this.loading = false
|
||||
|
||||
this.$store.dispatch('subscriptions/fetch')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user