suspend function returning too early
I have the below function which is completing 2 tasks asynchronously to upload data to Firebase Firestore. The 2nd function is returning the documentId of the new document created in Firestore and once done, the main function profileLiked
returns this documentId so I can use it elsewhere. However, the return function is completing before the Firebase upload async functions have run and hence is returning an empty string. How can I fix this?