4257 - Return localeData in same order as requested (#163)
This commit is contained in:
@@ -131,7 +131,10 @@ WHERE product_category.product_id = ?
|
|||||||
// use other functions.
|
// use other functions.
|
||||||
const res = await this.localeDataLoader.load(id);
|
const res = await this.localeDataLoader.load(id);
|
||||||
if (locales) {
|
if (locales) {
|
||||||
return res.filter((row) => locales.includes(row.locale));
|
// Sort result in same order as they were requested in locales filter
|
||||||
|
return locales.map((locale) => {
|
||||||
|
return res.find((row) => row.locale === locale);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user