rename LABEL_CREATED to LABEL_ATTACHED in webhook data

This commit is contained in:
Hongbo Wu
2024-03-22 10:49:26 +08:00
parent e2b3235046
commit 58511049a2

View File

@ -84,8 +84,14 @@ const sendNotification = async (obj: RuleActionObj) => {
const sendToWebhook = async (obj: RuleActionObj) => {
const [url] = obj.action.params
let event = obj.ruleEventType.toString()
// rename LABEL_CREATED to LABEL_ATTACHED
if (obj.ruleEventType === RuleEventType.LabelCreated) {
event = 'LABEL_ATTACHED'
}
const data = {
event: obj.ruleEventType,
event,
item: obj.data,
userId: obj.userId,
timestamp: Date.now(),