Skip to content

Commit e07bf19

Browse files
committed
fix: ScriptWebhookManager saveWebhook not functioning properly
1 parent ed2c0bd commit e07bf19

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

‎src/backend/common/handlers/custom-scripts/custom-script-helpers.js‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,17 @@ class ScriptWebhookManager extends EventEmitter {
2929
});
3030
}
3131

32-
saveWebhook(webhook) {
33-
if (webhook.name == null || webhook.name.trim() === "") {
32+
saveWebhook(name) {
33+
if (name == null || name.trim() === "") {
3434
return null;
3535
}
3636

3737
const existing = webhookManager
3838
.getAllItems()
39-
.find(w => w.name === webhook.name && w.scriptId === this.scriptName);
40-
41-
if (existing == null) {
42-
return null;
43-
}
39+
.find(w => w.name === name && w.scriptId === this.scriptName);
4440

4541
return webhookManager.saveItem({
46-
...webhook,
42+
name,
4743
id: existing?.id ?? undefined,
4844
scriptId: this.scriptName
4945
});

0 commit comments

Comments
 (0)