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) }} {