Finish home
All checks were successful
repod / nextcloud (push) Successful in 42s
repod / nodejs (push) Successful in 1m18s

This commit is contained in:
Michel Roux 2023-07-25 22:19:16 +02:00
parent f6f98a7003
commit 0f1ea1f5d0

View File

@ -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>