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"> height="20">
<Alert v-if="failed" /> <Alert v-if="failed" />
</template> </template>
<template #actions>
<NcActionButton @click="deleteSubscription">
<template #icon>
<Delete :size="20" />
</template>
{{ t('Delete') }}
</NcActionButton>
</template>
</NcAppNavigationItem> </NcAppNavigationItem>
</template> </template>
<script> <script>
import { NcActionButton, NcAppNavigationItem } from '@nextcloud/vue'
import Alert from 'vue-material-design-icons/Alert.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 axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router' import { generateUrl } from '@nextcloud/router'
import { showError } from '@nextcloud/dialogs'
export default { export default {
name: 'SubscriptionListItem', name: 'SubscriptionListItem',
components: { components: {
Alert, Alert,
Delete,
NcActionButton,
NcAppNavigationItem, NcAppNavigationItem,
}, },
props: { props: {
@ -50,5 +62,21 @@ export default {
this.loading = false 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> </script>