fix: delete note
This commit is contained in:
parent
37053c3c4e
commit
6e10297836
@ -13,12 +13,30 @@
|
|||||||
<div v-if="notes.data" class="grid grid-cols-4 gap-4 p-5">
|
<div v-if="notes.data" class="grid grid-cols-4 gap-4 p-5">
|
||||||
<div
|
<div
|
||||||
v-for="note in notes.data"
|
v-for="note in notes.data"
|
||||||
class="flex flex-col justify-between gap-2 px-5 py-4 border rounded-lg h-52 shadow-sm hover:bg-gray-50 cursor-pointer"
|
class="group flex flex-col justify-between gap-2 px-5 py-4 border rounded-lg h-52 shadow-sm hover:bg-gray-50 cursor-pointer"
|
||||||
@click="openNoteModal(note)"
|
@click="openNoteModal(note)"
|
||||||
>
|
>
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
<div class="text-lg font-medium truncate">
|
<div class="text-lg font-medium truncate">
|
||||||
{{ note.title }}
|
{{ note.title }}
|
||||||
</div>
|
</div>
|
||||||
|
<Dropdown
|
||||||
|
:options="[
|
||||||
|
{
|
||||||
|
icon: 'trash-2',
|
||||||
|
label: 'Delete',
|
||||||
|
onClick: () => deleteNote(note.name),
|
||||||
|
},
|
||||||
|
]"
|
||||||
|
@click.stop
|
||||||
|
>
|
||||||
|
<Button
|
||||||
|
icon="more-horizontal"
|
||||||
|
variant="ghosted"
|
||||||
|
class="hover:bg-white"
|
||||||
|
/>
|
||||||
|
</Dropdown>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
class="flex-1 text-base leading-5 text-gray-700 overflow-hidden"
|
class="flex-1 text-base leading-5 text-gray-700 overflow-hidden"
|
||||||
v-html="note.content"
|
v-html="note.content"
|
||||||
@ -78,6 +96,7 @@ import {
|
|||||||
TextEditor,
|
TextEditor,
|
||||||
TextInput,
|
TextInput,
|
||||||
call,
|
call,
|
||||||
|
Dropdown,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { nextTick, ref } from 'vue'
|
import { nextTick, ref } from 'vue'
|
||||||
|
|
||||||
@ -144,4 +163,12 @@ async function updateNote() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function deleteNote(name) {
|
||||||
|
await call('frappe.client.delete', {
|
||||||
|
doctype: 'CRM Note',
|
||||||
|
name,
|
||||||
|
})
|
||||||
|
notes.reload()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user