kawalcovid19 / wargabantuwarga.com

Inisiatif warga untuk berbagi informasi seputar fasilitas kesehatan dan alat kesehatan untuk COVID-19.
https://www.wargabantuwarga.com
MIT License
556 stars 166 forks source link

Use the `wbw-vaccination-database.json` data to replace all `Tempat vaksin` data from `wbw-database.json` #805

Open zainfathoni opened 3 years ago

redhoyasa commented 3 years ago

Hi there, I'm interested to work on this but certainly it needs https://github.com/kawalcovid19/wargabantuwarga.com/issues/803 to be done.

I can think of two approaches to do this.

Approach 1 Read from both wbw-vaccination-database.json and wbw-database.json when opening /provinces/[provinceSlug] and replace the Tempat Vaksin in wbw-database.json with ones from wbw-vaccination-database.json

Approach 2 Combine wbw-vaccination-database.json and wbw-database.json and create new file such as contacts.json. The ProvincePage will read the Contacts from there.

I think approach 2 is preferrable given the wbw architecture.

wdyt @zainfathoni ?

zainfathoni commented 3 years ago

Thanks for taking the initiative!

Since we're using getStaticProps, the JSON data source doesn't really matter, because it will be rebuilt by NextJS anyway. So to make things simple, I prefer the first approach because it requires no further processing into another JSON file.

I think merging wbw-vaccination-database.json and wbw-database.json directly in-memory within the getStaticProps function should suffice.

803 should be closed soon, so get ready to work on it once it's closed, @redhoyasa. 😉