Merge pull request #1812 from automatisch/AUT-917
fix: expose missing createdAt and updatedAt fields from flow
This commit is contained in:
@@ -6,6 +6,8 @@ const flowSerializer = (flow) => {
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.status,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
if (flow.steps?.length > 0) {
|
||||
|
@@ -27,6 +27,8 @@ describe('flowSerializer', () => {
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.status,
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
};
|
||||
|
||||
expect(flowSerializer(flow)).toEqual(expectedPayload);
|
||||
|
@@ -9,6 +9,8 @@ const getExecutionMock = async (execution, flow, steps) => {
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: steps.map((step) => ({
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
|
@@ -10,6 +10,8 @@ const getExecutionsMock = async (executions, flow, steps) => {
|
||||
name: flow.name,
|
||||
active: flow.active,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: steps.map((step) => ({
|
||||
id: step.id,
|
||||
type: step.type,
|
||||
|
@@ -4,6 +4,8 @@ const getFlowMock = async (flow, steps) => {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: steps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
|
@@ -7,6 +7,8 @@ const getFlowsMock = async (flows, steps) => {
|
||||
id: flow.id,
|
||||
name: flow.name,
|
||||
status: flow.active ? 'published' : 'draft',
|
||||
createdAt: flow.createdAt.getTime(),
|
||||
updatedAt: flow.updatedAt.getTime(),
|
||||
steps: flowSteps.map((step) => ({
|
||||
appKey: step.appKey,
|
||||
iconUrl: step.iconUrl,
|
||||
|
@@ -241,6 +241,7 @@ export const FlowPropType = PropTypes.shape({
|
||||
PropTypes.instanceOf(Date),
|
||||
]),
|
||||
updatedAt: PropTypes.oneOfType([
|
||||
PropTypes.number,
|
||||
PropTypes.string,
|
||||
PropTypes.instanceOf(Date),
|
||||
]),
|
||||
|
Reference in New Issue
Block a user