Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
joec05 committed Dec 11, 2023
1 parent e3d11da commit c05187c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ node_modules/

# dotenv environment variables file
.env

.vercel
16 changes: 14 additions & 2 deletions dist/controllers/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -2280,8 +2280,20 @@ usersRoutes.get('/fetchTopData', (req, res) => __awaiter(void 0, void 0, void 0,
const fetchTopUsers = yield profilesClient.query(fetchTopUsersQuery, [currentID, paginationLimit]);
const usersID = fetchTopUsers.rows.map((e) => e.user_id);
var getCompleteUsersData = yield getUsersListFilteredData(usersID, currentID);
const usersProfileData = [...new Set([...getCompleteUsersData.usersProfileData, ...getCompletePostsData.usersProfileData])];
const usersSocialsData = [...new Set([...getCompleteUsersData.usersSocialsData, ...getCompletePostsData.usersSocialsData])];
var combinedUsersID = [];
var combinedUsersProfileData = [...getCompleteUsersData.usersProfileData, ...getCompletePostsData.usersProfileData];
var combinedUsersSocialsData = [...getCompleteUsersData.usersSocialsData, ...getCompletePostsData.usersSocialsData];
var filteredUsersProfileData = [];
var filteredUsersSocialsData = [];
for (var i = 0; i < combinedUsersProfileData.length; i++) {
if (!combinedUsersID.includes(combinedUsersProfileData[i].user_id)) {
combinedUsersID.push(combinedUsersProfileData[i].user_id);
filteredUsersProfileData.push(combinedUsersProfileData[i]);
filteredUsersSocialsData.push(combinedUsersSocialsData[i]);
}
}
const usersProfileData = filteredUsersProfileData;
const usersSocialsData = filteredUsersSocialsData;
const fetchHashtagsDataQuery = `SELECT * FROM hashtags.hashtags_list ORDER BY hashtag_count DESC OFFSET $1 LIMIT $2`;
const fetchHashtagsData = yield keywordsClient.query(fetchHashtagsDataQuery, [0, paginationLimit]);
const hashtagsData = fetchHashtagsData.rows;
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ app.get('/', (req, res) => {
});
app.use('/users', usersRoutes);
httpServer.listen(port, () => console.log(`Server running on port: http://localhost:${port}`));
module.exports = app;
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,3 @@ app.use('/users', usersRoutes);


httpServer.listen(port, () => console.log(`Server running on port: http://localhost:${port}`));

15 changes: 0 additions & 15 deletions vercel.json

This file was deleted.

0 comments on commit c05187c

Please sign in to comment.