@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
27 lines (22 loc) • 532 B
text/typescript
import { IGenericSection } from '../../../generic/types';
import { IFileUpload } from "../../types";
import { transformText } from "./text";
export const transformFileUpload = (msg: IFileUpload) => {
const result: IGenericSection = {
type: 'section',
children: []
};
if (msg.label) {
result.children.push(transformText(msg.label));
}
const fileSection = {
type: 'file',
props: {
servicenow: {
type: msg.type
}
}
};
result.children.push(fileSection);
return result;
};