From 356b16aa9dcc4836521cfbe1da07f32c001003fe Mon Sep 17 00:00:00 2001 From: Mohamed Marrouchi Date: Fri, 17 Jan 2025 08:27:43 +0100 Subject: [PATCH] fix: rename payload to ensure consistency --- api/src/chat/schemas/types/quick-reply.ts | 2 +- api/src/chat/services/block.service.spec.ts | 2 +- api/src/extensions/channels/web/__test__/events.mock.ts | 2 +- api/src/extensions/channels/web/wrapper.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/src/chat/schemas/types/quick-reply.ts b/api/src/chat/schemas/types/quick-reply.ts index 18ae2b37..29ef17cd 100644 --- a/api/src/chat/schemas/types/quick-reply.ts +++ b/api/src/chat/schemas/types/quick-reply.ts @@ -19,7 +19,7 @@ export type Payload = } | { type: PayloadType.attachments; - attachments: AttachmentPayload; + attachment: AttachmentPayload; }; export enum QuickReplyType { diff --git a/api/src/chat/services/block.service.spec.ts b/api/src/chat/services/block.service.spec.ts index cf436248..fc489a26 100644 --- a/api/src/chat/services/block.service.spec.ts +++ b/api/src/chat/services/block.service.spec.ts @@ -389,7 +389,7 @@ describe('BlockService', () => { const result = blockService.matchPayload( { type: PayloadType.attachments, - attachments: { + attachment: { type: FileType.file, payload: { id: '9'.repeat(24), diff --git a/api/src/extensions/channels/web/__test__/events.mock.ts b/api/src/extensions/channels/web/__test__/events.mock.ts index 1c85ac63..4ffc80fb 100644 --- a/api/src/extensions/channels/web/__test__/events.mock.ts +++ b/api/src/extensions/channels/web/__test__/events.mock.ts @@ -146,7 +146,7 @@ export const webEvents: [string, Web.IncomingMessage, any][] = [ messageType: IncomingMessageType.attachments, payload: { type: IncomingMessageType.attachments, - attachments: { + attachment: { type: FileType.image, payload: { id: '9'.repeat(24), diff --git a/api/src/extensions/channels/web/wrapper.ts b/api/src/extensions/channels/web/wrapper.ts index e576c7d6..decb9301 100644 --- a/api/src/extensions/channels/web/wrapper.ts +++ b/api/src/extensions/channels/web/wrapper.ts @@ -225,7 +225,7 @@ export default class WebEventWrapper< return { type: PayloadType.attachments, - attachments: { + attachment: { type: Attachment.getTypeByMime(this._adapter.raw.data.type), payload: { id: this._adapter.attachment.id,