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