4257 - add multi locale support to categories resolver (#161)
This commit is contained in:
@@ -125,13 +125,13 @@ WHERE product_category.product_id = ?
|
||||
|
||||
async getLocaleDataForId(
|
||||
id: number,
|
||||
locale?: string,
|
||||
locales?: string[],
|
||||
): Promise<CategoryLocaleData[]> {
|
||||
// Dataloaders does not need scopes validation since they
|
||||
// use other functions.
|
||||
const res = await this.localeDataLoader.load(id);
|
||||
if (locale) {
|
||||
return res.filter((row) => row.locale === locale);
|
||||
if (locales) {
|
||||
return res.filter((row) => locales.includes(row.locale));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user