feat: Add icon urls to template serializer
This commit is contained in:
@@ -1,8 +1,18 @@
|
|||||||
|
import { generateIconUrl } from '../helpers/generate-icon-url.js';
|
||||||
|
|
||||||
const templateSerializer = (template) => {
|
const templateSerializer = (template) => {
|
||||||
|
const flowDataWithIconUrls = {
|
||||||
|
...template.flowData,
|
||||||
|
steps: template.flowData.steps?.map((step) => ({
|
||||||
|
...step,
|
||||||
|
iconUrl: generateIconUrl(step.appKey),
|
||||||
|
})),
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: template.id,
|
id: template.id,
|
||||||
name: template.name,
|
name: template.name,
|
||||||
flowData: template.flowData,
|
flowData: flowDataWithIconUrls,
|
||||||
createdAt: template.createdAt.getTime(),
|
createdAt: template.createdAt.getTime(),
|
||||||
updatedAt: template.updatedAt.getTime(),
|
updatedAt: template.updatedAt.getTime(),
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user