feat: discussions edit and delete

This commit is contained in:
Jannat Patel
2024-01-16 17:24:35 +05:30
parent 3a5977a718
commit 3313db844c
5 changed files with 185 additions and 60 deletions

View File

@@ -1,6 +1,9 @@
<template>
<div v-if="topics.data">
<div>
<Button class="float-right" @click="openQuestionModal()">
{{ __('Ask a Question') }}
</Button>
<div class="text-xl font-semibold">
{{ __(title) }}
</div>
@@ -36,7 +39,7 @@
</div>
</template>
<script setup>
import { createResource } from 'frappe-ui'
import { createResource, Button } from 'frappe-ui'
import UserAvatar from '@/components/UserAvatar.vue'
import { timeAgo } from '../utils'
import { ref, onMounted, inject } from 'vue'
@@ -45,6 +48,7 @@ import DiscussionReplies from '@/components/DiscussionReplies.vue'
const showTopics = ref(true)
const currentTopic = ref(null)
const socket = inject('$socket')
const showQuestionModal = ref(false)
const props = defineProps({
title: {
@@ -81,4 +85,8 @@ const showReplies = (topic) => {
showTopics.value = false
currentTopic.value = topic
}
const openQuestionModal = () => {
showQuestionModal.value = true
}
</script>