Skip to content

Commit 1e05d87

Browse files
committed
fix: fallback region to study_region in getHeritageById
1 parent 594937a commit 1e05d87

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/app/Packages/Domains/Test/QueryService/WorldHeritageQueryService_getByIdTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function arrayData(): array
6464
'name' => "Ancient and Primeval Beech Forests",
6565
'heritage_name_jp' => "カルパティア山脈とヨーロッパ各地の古代及び原生ブナ林",
6666
'country' => 'Slovakia',
67-
'region' => 'Europe',
67+
'study_region' => 'Europe',
6868
'category' => 'Natural',
6969
'criteria' => ['ix'],
7070
'state_party' => null,
@@ -149,7 +149,7 @@ public function test_check_data_value(): void
149149
$this->assertEquals($this->arrayData()['name'], $result->getName());
150150
$this->assertEquals($this->arrayData()['heritage_name_jp'], $result->getHeritageNameJp());
151151
$this->assertEquals($this->arrayData()['country'], $result->getCountry());
152-
$this->assertEquals($this->arrayData()['region'], $result->getRegion());
152+
$this->assertEquals($this->arrayData()['study_region'], $result->getRegion());
153153
$this->assertEquals($this->arrayData()['category'], $result->getCategory());
154154
$this->assertEquals($this->arrayData()['criteria'], $result->getCriteria());
155155
$this->assertEquals($this->arrayData()['state_party'], $result->getStateParty());

src/app/Packages/Domains/WorldHeritageQueryService.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function getHeritageById(int $id): WorldHeritageDto
170170
'heritage_name_jp' => $heritage->name_jp,
171171
'country' => $displayCountry,
172172
'country_name_jp' => $countryNameJp,
173-
'region' => $heritage->region,
173+
'region' => $heritage->study_region,
174174
'category' => $heritage->category,
175175
'year_inscribed' => $heritage->year_inscribed,
176176
'latitude' => $heritage->latitude,
@@ -199,6 +199,7 @@ public function getHeritagesByIds(array $ids, int $currentPage, int $perPage): P
199199
'name_jp',
200200
'country',
201201
'region',
202+
'study_region',
202203
'category',
203204
'criteria',
204205
'year_inscribed',
@@ -222,15 +223,8 @@ public function getHeritagesByIds(array $ids, int $currentPage, int $perPage): P
222223
$thumbnailQuery->select([
223224
'images.id',
224225
'images.world_heritage_id',
225-
'disk',
226226
'path',
227-
'width',
228-
'height',
229-
'format',
230-
'checksum',
231227
'sort_order',
232-
'alt',
233-
'credit',
234228
]);
235229
},
236230
])
@@ -283,7 +277,7 @@ public function getHeritagesByIds(array $ids, int $currentPage, int $perPage): P
283277
'name' => $heritage->name,
284278
'name_jp' => $heritage->name_jp,
285279
'country' => $heritage->country,
286-
'region' => $heritage->region,
280+
'region' => $heritage->study_region,
287281
'category' => $heritage->category,
288282
'criteria' => $heritage->criteria,
289283
'state_party' => $statePartyName,

0 commit comments

Comments
 (0)