Skip to content
Snippets Groups Projects
Commit acaba97c authored by 심재엽's avatar 심재엽
Browse files

refactor: 채팅방 생성 로직 합침

parent 0724a122
No related branches found
No related tags found
2 merge requests!31Develop,!25[#17] 채팅 푸시알림 추가
const chatService = require('../services/chatService');
// 내부용 채팅방 생성
exports.createChatRoomInternal = async (params) => {
exports.createChatRoom = async (params) => {
try {
return await chatService.createChatRoom(params);
const chatRoomId = await chatService.createChatRoom(params);
res.json(chatRoomId);
} catch (err) {
console.error('Error in createChatRoomInternal:', err);
return { success: false, error: err.message };
}
};
// 새 채팅방 생성
exports.createChatRoom = async (req, res) => {
try {
const chatRoomId = await chatService.createChatRoom();
res.json({ chatRoomId });
} catch (err) {
console.error('Error creating room:', err);
console.error('Error in createChatRoom:', err);
res.status(500).json({ error: 'Failed to create room' });
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment