From 7a16873d66e9ad2f9bced54b0ecf37c5f2c3cfa8 Mon Sep 17 00:00:00 2001 From: Net <93821485+somnetsak123@users.noreply.github.com> Date: Fri, 16 Feb 2024 16:21:19 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=95=E0=B8=A3=E0=B8=A7=E0=B8=88=E0=B8=AA?= =?UTF-8?q?=E0=B8=AD=E0=B8=9A=E0=B8=84=E0=B9=88=E0=B8=B2=20=20null=20?= =?UTF-8?q?=E0=B8=82=E0=B8=AD=E0=B8=87=20Category?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../00_support/components/FormChat.vue | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/src/modules/00_support/components/FormChat.vue b/src/modules/00_support/components/FormChat.vue index ffd5668a7..e51e90787 100644 --- a/src/modules/00_support/components/FormChat.vue +++ b/src/modules/00_support/components/FormChat.vue @@ -46,6 +46,11 @@ function getOnlineStatus(option: "icon" | "status", userId: string) { if (option === "status") return isOnline ? "ออนไลน์" : "ออฟไลน์"; } +function validateCategory(category: String | undefined) { + if (!!category) return category; + return "ระบุไม่ได้"; +} + onMounted(async () => { if (store.currentIssue) { await store.fetchIssue(); @@ -109,19 +114,22 @@ const onLoad = (async (_: any, done: any) => { - {{ store.currentTitle }} - - {{ store.currentCategory }} - + + + + {{ validateCategory(store.currentCategory) }} + + + {{ store.currentTitle }} + + - {{ getOnlineStatus("status", store.createdByUser) }} + {{ getOnlineStatus("status", store.createdByUserId) }} @@ -154,8 +162,8 @@ const onLoad = (async (_: any, done: any) => { store.currentIssue = item.id; store.currentTitle = item.title; store.correntStatusIssue = item.status; - store.currentCategory = item.category.name; - store.createdByUser = item.createdByUserId; + store.currentCategory = item.category?.name; + store.createdByUserId = item.createdByUserId; store.issue ? (store.issue.result = store.issue.result.map((v) => { if (v.id === item.id) { @@ -178,13 +186,14 @@ const onLoad = (async (_: any, done: any) => {
- - - {{ item.category.name }} - - - - {{ item.title }} + {{ item.createdByUserName }} + +

+ {{ + validateCategory(item.category?.name) + }} + {{ item.title }} +

{ :stamp="moment(item.createdAt).fromNow()" /> - {{ console.log(item.fromUserId === store.userId) }} {