Created
February 1, 2021 17:04
-
-
Save PamornT/03a109a5d02528759c26994a32ba780b 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
export const webhookTrello = functions.region(REGION).https.onRequest( async(req, res) => { | |
const action = req.body.action | |
if(action && action.display.translationKey !== 'unknown') { | |
const data = { | |
action: action, | |
changeTime: Date.now() + 25200000, | |
} | |
const board = action.data.board | |
board.changeTime = Date.now() + 25200000 | |
await firestore.collection('board').doc(action.data.board.id).set(board) | |
await firestore.collection('change').doc(action.id).set(data) | |
} | |
res.status(200).send("OK") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment