You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deploy and verify that all fuctions work the same as before:
yarn deploy
Translate the function convert to TypeScript:
exportletconvert=functions.database.ref('/conversions/{conversionID}').onWrite(event=>{varconversion=event.data.val()asConversions// Do not handle already converted valuesif(conversion.timestamp!==undefined)returnvareur=conversion.euradmin.database().ref('/rates').once('value').then(ratesSnapshot=>{letrates=ratesSnapshot.val()asRatesletresult=newConversions(eur)result.usd=eur*rates.usdresult.czk=eur*rates.czkresult.pln=eur*rates.plnresult.rub=eur*rates.rubresult.timestamp=Date.now()admin.database().ref('/conversions').child(event.params.conversionID).set(result)})})