feat: Add endpoint and service logic to clear all messages within a conversation.
This commit is contained in:
@@ -218,6 +218,21 @@ export class MessagesController {
|
||||
return this.messagesService.markMessagesAsRead(conversationId, userId);
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// CLEAR CHAT (delete messages, keep conversation)
|
||||
// ==========================================
|
||||
@Delete('conversations/:id/messages')
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@ApiOperation({ summary: 'Clear all messages in a conversation' })
|
||||
@ApiParam({ name: 'id', description: 'Conversation ID' })
|
||||
@ApiResponse({ status: 200, description: 'Messages cleared' })
|
||||
async clearChat(
|
||||
@Param('id') conversationId: string,
|
||||
@CurrentUser('id') userId: string,
|
||||
) {
|
||||
return this.messagesService.clearChat(conversationId, userId);
|
||||
}
|
||||
|
||||
// ==========================================
|
||||
// DELETE CONVERSATION
|
||||
// ==========================================
|
||||
|
||||
Reference in New Issue
Block a user