diff --git a/src/api/dimension/DimensionHookshotWebhookService.ts b/src/api/dimension/DimensionHookshotWebhookService.ts index 7eb4658..0402378 100644 --- a/src/api/dimension/DimensionHookshotWebhookService.ts +++ b/src/api/dimension/DimensionHookshotWebhookService.ts @@ -12,6 +12,7 @@ import { HookshotGithubBridge } from "../../bridges/HookshotGithubBridge"; import { HookshotWebhookBridge } from "../../bridges/HookshotWebhookBridge"; interface BridgeRoomRequest { + name?: string; } /** @@ -31,7 +32,7 @@ export class DimensionHookshotWebhookService { try { const hookshot = new HookshotWebhookBridge(userId); - return hookshot.newConnection(roomId); + return hookshot.newConnection(roomId, request.name); } catch (e) { LogService.error("DimensionHookshotWebhookService", e); throw new ApiError(400, "Error bridging room"); diff --git a/src/bridges/HookshotWebhookBridge.ts b/src/bridges/HookshotWebhookBridge.ts index d88d567..312854a 100644 --- a/src/bridges/HookshotWebhookBridge.ts +++ b/src/bridges/HookshotWebhookBridge.ts @@ -34,10 +34,11 @@ export class HookshotWebhookBridge extends HookshotBridge { return (await this.getAllRoomConfigurations(inRoomId)).filter(c => c.eventType === HookshotTypes.Webhook); } - public async newConnection(roomId: string): Promise { + public async newConnection(roomId: string, name: string): Promise { const bridge = await this.getDefaultBridge(); const body = { + name, }; return await this.doProvisionRequest(bridge, "PUT", `/v1/${roomId}/connections/${HookshotTypes.Webhook}`, null, body); } diff --git a/web/app/shared/models/hookshot_webhook.ts b/web/app/shared/models/hookshot_webhook.ts index 8f2f14f..4f8c2cf 100644 --- a/web/app/shared/models/hookshot_webhook.ts +++ b/web/app/shared/models/hookshot_webhook.ts @@ -9,7 +9,7 @@ export interface FE_HookshotWebhookBridge { export interface FE_HookshotWebhookConnection { id: string; config: { - name?: string; // TODO: Update according to bridge support + name?: string; url: string; }; }