Skip to content

Commit d749a43

Browse files
authored
Merge pull request #66 from BenjaminMedia/FORD-104-missing-files
Added locale to category repository find by brand id and name
2 parents 3065d11 + 47c95df commit d749a43

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Repositories/Scaphold/CategoryRepository.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ public static function find_by_brand_id($id, $cursor = '', $limit = 100)
3636
])->allCategories;
3737
}
3838

39-
public static function find_by_brand_id_and_name($id, $name, $cursor = '', $limit = 100)
39+
public static function find_by_brand_id_and_name($id, $name, $locale, $cursor = '', $limit = 100)
4040
{
4141
return Client::query(Queries::GET_CATEGORY_BY_BRAND_AND_NAME, [
4242
'name' => $name,
4343
'brandId' => $id,
44+
'locale' => $locale,
4445
'cursor' => $cursor,
4546
'limit' => $limit
4647
])->allCategories;

src/Scaphold/Queries.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ class Queries
6262
';
6363

6464
const GET_CATEGORY_BY_BRAND_AND_NAME = '
65-
query GetCategoryByNameAndBrand($brandId: ID!, $name: String!, $cursor: String!, $limit: Int!) {
65+
query GetCategoryByNameAndBrand($brandId: ID!, $name: String!, $locale: LocaleEnum!, $cursor: String!, $limit: Int!) {
6666
viewer {
67-
allCategories(where: {brand: {id: {eq: $brandId}}, name: {like: $name}}, first: $limit, after: $cursor) {
67+
allCategories(where: {brand: {id: {eq: $brandId}}, name: {like: $name}, locale: {eq: $locale}}, first: $limit, after: $cursor) {
6868
aggregations {
6969
count
7070
}

0 commit comments

Comments
 (0)