@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
20 lines (17 loc) • 572 B
text/typescript
import { IGenericAttachments } from "../../../generic/types";
import { SMSAttachment } from "../../types";
export const transformFileUpload = (attachments: Array<SMSAttachment>): IGenericAttachments => {
const result: IGenericAttachments = {
type: "attachments",
props: {
value: {
staticValue: attachments.map(attachment => {
return {
text: attachment.linkURL || attachment.location
};
})
}
}
};
return result;
};