Skip to content

Commit

Permalink
Remove unused getFollowedList endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennull committed Jan 10, 2025
1 parent 0df8a77 commit 490ab05
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 25 deletions.
12 changes: 0 additions & 12 deletions controllers/MessagesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ const getConversations = async (req, res) => {
}
};

const getFollowedList = async (req, res) => {
try {
const { userId } = req.query;
const query = await pool.query(messageQueries.getFollowedList, [userId]);
res.send(query.rows);
} catch (error) {
console.log(error);
res.status(500).send(error);
}
};

const getMessages = async (req, res) => {
try {
const { userId1, userId2 } = req.params;
Expand All @@ -61,6 +50,5 @@ const getMessages = async (req, res) => {
module.exports = {
addMessage,
getConversations,
getFollowedList,
getMessages,
};
12 changes: 0 additions & 12 deletions models/MessagesModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,6 @@ const getConversations = `
ORDER BY "userId", timestamp DESC;
`;

const getFollowedList = `
SELECT
u."userId",
u."displayName",
u."username"
FROM app_user u
INNER JOIN follow f
ON u."userId" = f."followedUserId"
WHERE f."followerUserId" = $1;
`;

const getMessages = `
SELECT *
FROM message
Expand All @@ -67,6 +56,5 @@ module.exports = {
addMessage,
getChatBio,
getConversations,
getFollowedList,
getMessages,
};
1 change: 0 additions & 1 deletion routes/messagesRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const messagesController = require("../controllers/MessagesController");
const router = Router();

router.get("/", messagesController.getConversations);
router.get("/followedList", messagesController.getFollowedList);
router.get("/:userId1/:userId2", messagesController.getMessages);
router.post("/", messagesController.addMessage);

Expand Down

0 comments on commit 490ab05

Please sign in to comment.