Add author property to Workflow endpoints
[MAILPOET-4417]
This commit is contained in:
@@ -34,6 +34,10 @@ class WorkflowsGetEndpoint extends Endpoint {
|
|||||||
'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C),
|
'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C),
|
||||||
'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C),
|
'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C),
|
||||||
'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null,
|
'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null,
|
||||||
|
'author' => [
|
||||||
|
'id' => $workflow->getAuthor()->ID,
|
||||||
|
'name' => $workflow->getAuthor()->display_name,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -53,6 +53,10 @@ class WorkflowsPutEndpoint extends Endpoint {
|
|||||||
'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C),
|
'created_at' => $workflow->getCreatedAt()->format(DateTimeImmutable::W3C),
|
||||||
'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C),
|
'updated_at' => $workflow->getUpdatedAt()->format(DateTimeImmutable::W3C),
|
||||||
'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null,
|
'activated_at' => $workflow->getActivatedAt() ? $workflow->getActivatedAt()->format(DateTimeImmutable::W3C) : null,
|
||||||
|
'author' => [
|
||||||
|
'id' => $workflow->getAuthor()->ID,
|
||||||
|
'name' => $workflow->getAuthor()->display_name,
|
||||||
|
],
|
||||||
'steps' => array_map(function (Step $step) {
|
'steps' => array_map(function (Step $step) {
|
||||||
return [
|
return [
|
||||||
'id' => $step->getId(),
|
'id' => $step->getId(),
|
||||||
|
Reference in New Issue
Block a user