Update newsletter templates js to work with data types from updated api.
[MAILPOET-2816]
This commit is contained in:
committed by
Veljko V
parent
59ce69eac5
commit
f44197f46b
@@ -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;
|
||||||
|
Reference in New Issue
Block a user