Created
May 29, 2022 16:55
-
-
Save PamornT/bfc2d162362946bc7f279ae472be9541 to your computer and use it in GitHub Desktop.
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
const checkPointExists = async(event) => { | |
try { | |
const userId = event.source.userId | |
const trackingId = event.videoPlayComplete.trackingId | |
const data = await admin.firestore() | |
.collection('collectPoint') | |
.where('userId', '==', userId) | |
.where('trackingId', '==', trackingId) | |
.get() | |
return !data.empty | |
} catch (error) { | |
console.error(error) | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment