Update newsletter templates js to work with data types from updated api.

[MAILPOET-2816]
This commit is contained in:
Rostislav Wolny
2020-04-13 11:20:34 +02:00
committed by Veljko V
parent 59ce69eac5
commit f44197f46b

View File

@@ -80,7 +80,7 @@ class NewsletterTemplates extends React.Component {
name: name:
MailPoet.I18n.t('mailpoetGuideTemplateTitle'), MailPoet.I18n.t('mailpoetGuideTemplateTitle'),
categories: '["welcome", "notification", "standard", "woocommerce"]', categories: '["welcome", "notification", "standard", "woocommerce"]',
readonly: '1', readonly: true,
}, },
]; ];
} }
@@ -129,7 +129,7 @@ class NewsletterTemplates extends React.Component {
sortTemplates() { sortTemplates() {
Object.keys(this.templates).forEach((category) => { Object.keys(this.templates).forEach((category) => {
this.templates[category].sort((a, b) => { this.templates[category].sort((a, b) => {
if (parseInt(a.id, 10) < parseInt(b.id, 10)) { if (a.id < b.id) {
return 1; return 1;
} }
return -1; return -1;