Skip to content
Snippets Groups Projects
Commit 3f91cdc7 authored by 조대희's avatar 조대희
Browse files

feat: 친구 요청 보내기 컨트롤러 (#8)

parent 33c5c6b7
No related branches found
No related tags found
2 merge requests!31Develop,!9[#8] Friend 컨트롤러, 라우터 로직 개발
const FriendService = require('../services/friendService');
class friendController {
/**
* 친구 요청 보내기
* POST /api/friend/request
*/
async sendRequest(req, res) {
try {
const userId = req.user.id;
const { friendId } = req.body;
const request = await FriendService.sendFriendRequest(userId, friendId);
return res.status(201).json({
success: true,
data: request
});
} catch (error) {
return res.status(400).json({
success: false,
error: {
message: error.message,
code: 'FRIEND_REQUEST_ERROR'
}
});
}
}
}
module.exports = new friendController();
\ No newline at end of file
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