Skip to content

Commit aa7c259

Browse files
deer-wmdedati18
andauthored
Update app/Http/Resources/PolicyResource.php
Co-authored-by: Dat WMDE <dat.nguyen@wikimedia.de>
1 parent 445adda commit aa7c259

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

app/Http/Resources/PolicyResource.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ public function toArray(Request $request): array {
2525
'metadata' => [
2626
'policy_id' => $this->id,
2727
'type' => $this->policy_type,
28-
'active_from' => $activeFrom,
28+
'active_from' => $this->active_from === null
29+
? null
30+
: Carbon::parse($this->active_from)->format('Y-m-d'),
2931
'content_vue_file' => $this->content_vue_file,
3032
],
3133
];

0 commit comments

Comments
 (0)