wargabantuwarga.com icon indicating copy to clipboard operation
wargabantuwarga.com copied to clipboard

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

Open zainfathoni opened this issue 3 years ago • 2 comments

zainfathoni avatar Oct 08 '21 13:10 zainfathoni

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 ?

redhoyasa avatar Oct 13 '21 07:10 redhoyasa

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. 😉

zainfathoni avatar Oct 13 '21 15:10 zainfathoni