From 992fbb6ada69dea47fa60c2dffc1e1e56e558917 Mon Sep 17 00:00:00 2001 From: bhc Date: Mon, 8 Apr 2024 18:11:14 +0300 Subject: [PATCH] Update message controller to use imageId and audioId instead of image and audio --- src/controllers/message.controller.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/controllers/message.controller.ts b/src/controllers/message.controller.ts index 21238d5..6f420b0 100644 --- a/src/controllers/message.controller.ts +++ b/src/controllers/message.controller.ts @@ -46,10 +46,10 @@ export default class MessageController { throwIfMissing(req.body, ["body"]); break; case "image": - throwIfMissing(req.body, ["image"]); + throwIfMissing(req.body, ["imageId"]); break; case "audio": - throwIfMissing(req.body, ["audio"]); + throwIfMissing(req.body, ["audioId"]); break; default: // Send error response @@ -127,8 +127,8 @@ export default class MessageController { deleted: false, type: type, body: null, - image: null, - audio: null, + imageId: null, + audioId: null, }; switch (type) { @@ -141,13 +141,13 @@ export default class MessageController { case "image": messageData = { ...messageData, - image: req.body.image, + imageId: req.body.imageId, }; break; case "audio": messageData = { ...messageData, - audio: req.body.audio, + audioId: req.body.audioId, }; break; default: @@ -313,8 +313,8 @@ export default class MessageController { deleted: true, type: "body", body: "[deleted message]", - image: null, - audio: null, + imageId: null, + audioId: null, } ); console.log(message);