This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Use this [ActivityResultContract] to seamlessly switch between | |
* the new [MediaStore.ACTION_PICK_IMAGES] and [Intent.ACTION_GET_CONTENT] | |
* based on the availability of the Photo Picker. | |
* | |
* Use [PickMultipleImages] if you'd like the user to be able to select multiple | |
* photos/videos. | |
* | |
* Input: the mimeType you'd like to receive. This should generally be | |
* either `image/\*` or `video/\*` for requesting only images or only videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const covid19UserResponse = functions.https.onCall(async (data, context) => { | |
try { | |
// https://docs.google.com/spreadsheets/d/13x-6koKiqRnIK6_trJX-abLJyi65OzqV621u9iwM1qw/edit#gid=2008915096 | |
await admin.firestore().collection('corona-user-responses').add(data); | |
// tslint:disable-next-line:radix | |
let is_elder = parseInt(data['age']['answer']) > 60 ? '1' : '0'; | |
let has_diseases_history = data['high_risk']['answer'] === 'true' ? '1' : '0'; |