Finish home
This commit is contained in:
parent
f6f98a7003
commit
0f1ea1f5d0
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user