Skip to content

Commit

Permalink
Add template type prefix to exported file
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jan 17, 2025
1 parent 3fe582d commit 723a274
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/template/services/ExportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ public function export(): self

private function getFileName(): string
{
return $this->template->name . '_' . date('Y-m-d_H-i') . '.json';
$type = match ($this->template->type) {
Template::TYPE_CONTAINER => 'Container',
Template::TYPE_SNIPPED_LAYOUT => 'Snippet Layout',
default => 'Layout',
};

return $type . '_' . $this->template->name . '_' . date('Y-m-d_H-i') . '.json';
}

public function send(): Response
Expand Down

0 comments on commit 723a274

Please sign in to comment.