260826_01_ENH: notihub 수정으로 인한 후속 조치
This commit is contained in:
@@ -1,4 +1,18 @@
|
||||
import {PerformanceFull, UserCompact} from "@/types/gwcf";
|
||||
import {TMPLAT_PURPOSE, Template} from "@/types/notification";
|
||||
|
||||
export const PHONE_VERIFICATION_PREVIEW = "인증번호는 [######] 입니다.";
|
||||
|
||||
export const isPhoneVerificationSupported = (template: Pick<Template, "tmplatTy">) =>
|
||||
template.tmplatTy === 10 || template.tmplatTy === 20;
|
||||
|
||||
export const buildTemplatePreviewBody = (template: Pick<Template, "tmplatBody" | "tmplatPurpose">) =>
|
||||
template.tmplatPurpose === TMPLAT_PURPOSE.PHONE_VERIFICATION
|
||||
? `${template.tmplatBody}\n${PHONE_VERIFICATION_PREVIEW}`
|
||||
: template.tmplatBody;
|
||||
|
||||
export const getSmsByteLength = (value: string) =>
|
||||
Array.from(value).reduce((total, character) => total + (character.charCodeAt(0) > 0x7f ? 2 : 1), 0);
|
||||
|
||||
export const toNotificationParamValue = (value: unknown) => value == null ? "" : String(value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user