Skip to content

Commit 95522f0

Browse files
author
Jicheng Lu
committed
add conv channels
1 parent 44d78f6 commit 95522f0

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/lib/helpers/enums.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,18 @@ const conversationTag = {
135135
};
136136
export const ConversationTag = Object.freeze(conversationTag);
137137

138+
const conversationChannel = {
139+
WebChat: "webchat",
140+
OpenAPI: "openapi",
141+
Phone: "phone",
142+
SMS: "sms",
143+
Messenger: "messenger",
144+
Email: "email",
145+
Crontab: "crontab",
146+
Database: "database"
147+
};
148+
export const ConversationChannel = Object.freeze(conversationChannel);
149+
138150
const userPermission = {
139151
CreateAgent: "create-agent"
140152
};

src/routes/page/conversation/+page.svelte

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
import Swal from 'sweetalert2';
2727
import lodash from "lodash";
2828
import MultiSelect from '$lib/common/MultiSelect.svelte';
29-
import { ConversationTag } from '$lib/helpers/enums';
29+
import { ConversationChannel, ConversationTag } from '$lib/helpers/enums';
3030
3131
let isLoading = false;
3232
let isComplete = false;
@@ -63,11 +63,9 @@
6363
];
6464
6565
/** @type {import('$commonTypes').IdName[]} */
66-
let channelOptions = [
67-
{ id: 'webchat', name: 'Live Chat' },
68-
{ id: 'phone', name: 'Phone' },
69-
{ id: 'email', name: 'Email' }
70-
];
66+
let channelOptions = Object.entries(ConversationChannel).map(([k, v]) => (
67+
{ id: v, name: v }
68+
));
7169
7270
/** @type {import('$commonTypes').KeyValuePair[]} */
7371
let tagOptions = Object.entries(ConversationTag).map(([k, v]) => (

0 commit comments

Comments
 (0)