upd: diskusi

Deskripsi:
- pembatasan user role
- log user

No Issues
This commit is contained in:
amel
2024-09-10 11:27:47 +08:00
parent 88e75db420
commit daa5d87b02
4 changed files with 38 additions and 8 deletions

View File

@@ -52,19 +52,25 @@ export default function DetailDiscussion({ id, idDivision }: { id: string, idDiv
getData()
}, [refresh.get()])
async function reloadData() {
try {
const response = await funGetDiscussionById(id)
setData(response.data)
} catch (error) {
console.error(error)
}
}
const sendComent = async () => {
try {
if (isComent.trim() == "") {
return toast.error("Masukkan Komentar Anda")
}
const response = await funCreateComent(id, {
comment: isComent,
idDiscussion: param.detail
})
const response = await funCreateComent(id, { comment: isComent, idDiscussion: param.detail })
if (response.success) {
setIsComent("")
getData()
reloadData()
} else {
toast.error(response.message)
}