Skip to content

Commit

Permalink
Update message controller to use imageId and audioId instead of image…
Browse files Browse the repository at this point in the history
… and audio
  • Loading branch information
xuelink committed Apr 8, 2024
1 parent 8b1f8b3 commit 992fbb6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/controllers/message.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -127,8 +127,8 @@ export default class MessageController {
deleted: false,
type: type,
body: null,
image: null,
audio: null,
imageId: null,
audioId: null,
};

switch (type) {
Expand All @@ -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:
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 992fbb6

Please sign in to comment.