261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현
This commit is contained in:
@@ -14,16 +14,17 @@ import {
|
||||
useTemplateListQuery,
|
||||
useTemplateQuery,
|
||||
} from '@/query/message'
|
||||
import { ChannelType, type TemplateSummary } from '@kri/common/noti-hub'
|
||||
import { getNearestFutureDateTime } from '@/lib/datetime'
|
||||
import type { TemplateSummary } from '@kri/common/noti-hub'
|
||||
import { getNearestFutureDateTime, toReserveSendDt } from '@/lib/datetime'
|
||||
import type { DialogId } from '@/store/jotai/dialog'
|
||||
import type { MessageSendChannel, PhoneVerificationSendData } from '@/types/message'
|
||||
import MessageSendPreview from '@/components/message-template/MessageSendPreview'
|
||||
import { TEMPLATE_PURPOSE } from '@/const/messageTemplateConst'
|
||||
import { TEMPLATE_PURPOSE, MESSAGE_CHANNEL_TYPE } from '@/const/messageTemplateConst'
|
||||
|
||||
const titleMap: Record<MessageSendChannel, string> = {
|
||||
email: '메일 발송',
|
||||
sms: '문자 발송',
|
||||
kko: '알림톡 발송',
|
||||
}
|
||||
|
||||
export type SingleMessageSendDialogProps = {
|
||||
@@ -54,7 +55,7 @@ const SingleMessageSendDialog = ({
|
||||
const { isDialogOpen, showDialog, hideDialog } = useDialog()
|
||||
const resolvedOpen = open ?? isDialogOpen(dialogId)
|
||||
|
||||
const chnnlTy = channel === 'email' ? ChannelType.EMAIL : ChannelType.SMS
|
||||
const chnnlTy = MESSAGE_CHANNEL_TYPE[channel]
|
||||
|
||||
const [templateIdx, setTemplateIdx] = useState<number | null>(null)
|
||||
const [scheduleType, setScheduleType] = useState<'instant' | 'reserve'>('instant')
|
||||
@@ -132,7 +133,7 @@ const SingleMessageSendDialog = ({
|
||||
const res = await sendSingleMutation.mutateAsync({
|
||||
tmplatIdx: templateIdx,
|
||||
resve: scheduleType === 'reserve',
|
||||
sendDt: scheduleType === 'reserve' ? new Date(reserveAt).toISOString() : undefined,
|
||||
sendDt: scheduleType === 'reserve' ? toReserveSendDt(reserveAt) : undefined,
|
||||
sid,
|
||||
destHeaderIds: [destHeaderId],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user