From 4bdec5165d9d76a72dba9b749b2961709fe234b1 Mon Sep 17 00:00:00 2001 From: David Remer Date: Wed, 10 Aug 2022 12:28:19 +0300 Subject: [PATCH] Add activated_at property to workflow endpoints [MAILPOET-4417] --- .../Engine/Endpoints/Workflows/WorkflowsGetEndpoint.php | 1 + .../Engine/Endpoints/Workflows/WorkflowsPutEndpoint.php | 1 + 2 files changed, 2 insertions(+) diff --git a/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsGetEndpoint.php b/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsGetEndpoint.php index 64b1f17c80..658439bd6e 100644 --- a/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsGetEndpoint.php +++ b/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsGetEndpoint.php @@ -33,6 +33,7 @@ class WorkflowsGetEndpoint extends Endpoint { 'status' => $workflow->getStatus(), 'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C), 'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C), + 'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null, ]; } } diff --git a/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsPutEndpoint.php b/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsPutEndpoint.php index 47fbf29452..46996f5844 100644 --- a/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsPutEndpoint.php +++ b/mailpoet/lib/Automation/Engine/Endpoints/Workflows/WorkflowsPutEndpoint.php @@ -52,6 +52,7 @@ class WorkflowsPutEndpoint extends Endpoint { 'status' => $workflow->getStatus(), 'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C), 'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C), + 'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null, 'steps' => array_map(function (Step $step) { return [ 'id' => $step->getId(),