Skip to content

Instantly share code, notes, and snippets.

@PamornT
Created February 1, 2021 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PamornT/03a109a5d02528759c26994a32ba780b to your computer and use it in GitHub Desktop.
Save PamornT/03a109a5d02528759c26994a32ba780b to your computer and use it in GitHub Desktop.
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