Ensure the right order

[MAILPOET-1480]
This commit is contained in:
Pavel Dohnal
2018-09-13 09:46:37 +02:00
parent 41880f72fd
commit f6bf32de01
2 changed files with 24 additions and 20 deletions

View File

@ -31,8 +31,9 @@ class NewsletterTemplates extends APIEndpoint {
function getAll() {
$collection = NewsletterTemplate
::selectExpr('id, categories, thumbnail, name, description, readonly')
->orderByAsc('readonly')
->orderByDesc('created_at')
->orderByAsc('name')
->orderByDesc('id')
->findMany();
$templates = array_map(function($item) {
return $item->asArray();