Updated sorted price list in product details

refs https://github.com/TryGhost/Team/issues/641

By default, the prices list for a Product will be now shown sorted based on this order -> Active -> Currency -> Amount.
This commit is contained in:
Rishabh 2021-05-09 18:14:36 +05:30
parent 575f85a8ca
commit fab98939fd

View File

@ -30,6 +30,12 @@ export default class ProductController extends Controller {
...d,
amount: d.amount / 100
};
}).sort((a, b) => {
return a.amount - b.amount;
}).sort((a, b) => {
return a.currency.localeCompare(b.currency, undefined, {ignorePunctuation: true});
}).sort((a, b) => {
return (a.active === b.active) ? 0 : (a.active ? -1 : 1);
});
}