UNPKG

@onereach/channel-transformer

Version:

Convert data model between different channels (Slack, Microsoft Teams, Generic...)

13 lines (9 loc) 453 B
import { IGenericAttachments } from "../../../generic/types"; import { INiceCxoneAttachment, INiceCxoneEvent } from "../../types"; export const transformAttachments = ({ props }: IGenericAttachments): Partial<INiceCxoneEvent> => { const atts = props?.value?.staticValue || props?.value?.filesValue; const attachments: Array<INiceCxoneAttachment> = atts?.map((att) => { return { url: att.text }; }); return { attachments }; };