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 flowDataWithIconUrls = {
|
||||
...template.flowData,
|
||||
steps: template.flowData.steps?.map((step) => ({
|
||||
...step,
|
||||
iconUrl: generateIconUrl(step.appKey),
|
||||
})),
|
||||
};
|
||||
|
||||
return {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
flowData: template.flowData,
|
||||
flowData: flowDataWithIconUrls,
|
||||
createdAt: template.createdAt.getTime(),
|
||||
updatedAt: template.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user