From 94e1cd9944afd62071f1c86aaef37b1c903efe16 Mon Sep 17 00:00:00 2001 From: Tom Winter Date: Mon, 19 Feb 2024 08:13:18 +0100 Subject: [PATCH] fix: small code fixes --- src/notification/controller/dtos.ts | 12 ++++++------ src/notification/controller/webhook.controller.ts | 1 + src/notification/storage/webhook-storage.service.ts | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/notification/controller/dtos.ts b/src/notification/controller/dtos.ts index 4292c6f..11af76a 100644 --- a/src/notification/controller/dtos.ts +++ b/src/notification/controller/dtos.ts @@ -1,3 +1,5 @@ +import { Reference } from '../../domain/reference'; + export interface WebhookDto { id: string; name: string; @@ -6,6 +8,7 @@ export interface WebhookDto { url: string; }; authenticationType: 'API_KEY'; + reportSubscriptions: Reference[]; } export interface CreateWebhookDto { @@ -14,13 +17,10 @@ export interface CreateWebhookDto { method: 'GET' | 'POST'; url: string; }; - authentication: { - type: 'API_KEY'; - apiKey: string; - }; + authentication: ApiKeyAuthConfig; } export interface ApiKeyAuthConfig { - key: string; - headerName: string; + type: 'API_KEY'; + apiKey: string; } diff --git a/src/notification/controller/webhook.controller.ts b/src/notification/controller/webhook.controller.ts index 8b364ed..5b12420 100644 --- a/src/notification/controller/webhook.controller.ts +++ b/src/notification/controller/webhook.controller.ts @@ -101,6 +101,7 @@ export class WebhookController { name: webhook.label, target: webhook.target, authenticationType: webhook.authentication.type, + reportSubscriptions: webhook.reportSubscriptions, }; } } diff --git a/src/notification/storage/webhook-storage.service.ts b/src/notification/storage/webhook-storage.service.ts index b6c5236..160e9c9 100644 --- a/src/notification/storage/webhook-storage.service.ts +++ b/src/notification/storage/webhook-storage.service.ts @@ -101,7 +101,7 @@ export class WebhookStorage { }, owner: { type: 'USER', - id: 'todo-user-id-here', + id: 'todo-user-id-here', // todo }, reportSubscriptions: [], })