Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
fix(server): treat 2021 related data in datacatalog v2 as 2020 in dat…
Browse files Browse the repository at this point in the history
…acatalogv3
  • Loading branch information
rot1024 committed Feb 7, 2024
1 parent 7926dcb commit c3a97ef
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ func relatedDatasetFrom(d datacatalogv2.DataCatalogItem) (plateauapi.RelatedData
return plateauapi.RelatedDataset{}, false
}

year := d.Year
if year == 2021 {
// 2021年のデータは2020年のデータとして扱うことで
// マージ後のデータカタログではPLATEAU-2023以降のデータが優先表示されるようにする
year = 2020
}

id := datasetIDFrom(d, nil)
items := d.MainOrConfigItems()
return plateauapi.RelatedDataset{
Expand All @@ -207,7 +214,7 @@ func relatedDatasetFrom(d datacatalogv2.DataCatalogItem) (plateauapi.RelatedData
CityCode: cityCodeFrom(d),
WardID: wardIDFrom(d),
WardCode: wardCodeFrom(d),
Year: d.Year,
Year: year,
TypeID: datasetTypeIDFrom(d),
TypeCode: datasetTypeCodeFrom(d),
Groups: groupsFrom(d),
Expand Down

0 comments on commit c3a97ef

Please sign in to comment.