accept authorization to be undefined

pull/941/head
CamilleLegeron 1 month ago
parent 62b0ae3578
commit 2e7ec0da76

@ -1953,7 +1953,7 @@ export class HomeDBManager extends EventEmitter {
// Update the webhook url in the webhook's corresponding secret (note: the webhook identifier is
// its secret identifier).
public async updateWebhookUrlAndAuth(
id: string, docId: string, url: string, auth: string, outerManager?: EntityManager) {
id: string, docId: string, url: string, auth: string | undefined, outerManager?: EntityManager) {
return await this._runInTransaction(outerManager, async manager => {
const value = await this.getSecret(id, docId, manager);
if (!value) {

@ -935,8 +935,8 @@ export class DocWorkerApi {
const triggerRowId = activeDoc.triggers.getWebhookTriggerRecord(webhookId).id;
// update url and authorization header in homedb
if (url) {
await this._dbManager.updateWebhookUrlAndAuth(webhookId, docId, url, authorization || "");
if (url || authorization) {
await this._dbManager.updateWebhookUrlAndAuth(webhookId, docId, url, authorization || undefined);
activeDoc.triggers.webhookDeleted(webhookId); // clear cache
}

Loading…
Cancel
Save