Implement delete note
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
<div class="popover" :class="{ compact }" ref="popover">
|
||||
<button @click="favorite">%i18n:@favorite%</button>
|
||||
<button v-if="note.userId == $store.state.i.id" @click="pin">%i18n:@pin%</button>
|
||||
<button v-if="note.userId == $store.state.i.id" @click="del">%i18n:@delete%</button>
|
||||
<a v-if="note.uri" :href="note.uri" target="_blank">%i18n:@remote%</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -59,6 +60,15 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
del() {
|
||||
if (!window.confirm('%i18n:@delete-confirm%')) return;
|
||||
(this as any).api('notes/delete', {
|
||||
noteId: this.note.id
|
||||
}).then(() => {
|
||||
this.$destroy();
|
||||
});
|
||||
},
|
||||
|
||||
favorite() {
|
||||
(this as any).api('notes/favorites/create', {
|
||||
noteId: this.note.id
|
||||
|
Reference in New Issue
Block a user