Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main to release #123

Merged
merged 43 commits into from
Nov 2, 2023
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
512c725
Add Jest testing (#63)
kidzegeye Nov 14, 2022
a0c56bb
Add Docstrings to Test Factory Functions (#64)
kidzegeye Nov 17, 2022
f974d1a
Update README.md
snajima Feb 15, 2023
bf2774c
Implement community board models (#65)
isaachan100 Mar 18, 2023
6505521
Add magazines to weekly debrief (#66)
isaachan100 Mar 20, 2023
8cd07aa
Implement reshuffle articles (#68)
SashaLoayza Mar 23, 2023
08705a4
Implement magazine search (#69)
isaachan100 Mar 23, 2023
ca89a00
Convert result of shuffling resolver to ArticleModel (#71)
SashaLoayza Mar 25, 2023
274b344
Add 3 new publications (Cornell Daily Sun, Collective X, and Cornell …
SashaLoayza Apr 4, 2023
eccf00c
Resolve merge conflicts in publications.json (keep release version) (…
SashaLoayza Apr 12, 2023
94ddfa2
Revert "Resolve merge conflicts in publications.json (keep release ve…
isaachan100 Apr 12, 2023
ebd91ec
fix merge conflicts (#78)
SashaLoayza Apr 12, 2023
573b70d
Implement community board [1/7] (#81)
isaachan100 Apr 21, 2023
904c4ae
Add imageURL field to Magazine entity. (#73)
SashaLoayza Apr 21, 2023
e012894
Add no rules to volume-backend's publications.json (#82)
SashaLoayza Apr 23, 2023
34f1bd8
Implement community board (flyer tests) [2/7] (#84)
isaachan100 Apr 25, 2023
ed6913f
Implement community board organizations (#85)
isaachan100 Apr 26, 2023
e0dcd22
Implement community board (organization tests) [4/7] (#86)
isaachan100 Apr 27, 2023
5cd38cd
Implement community board (user queries/mutations) [5/7] (#87)
isaachan100 Apr 28, 2023
048a834
Onboard organizations (#90)
isaachan100 May 1, 2023
b1f9cad
Implement community board (categories and org lists) [6/7] (#89)
isaachan100 May 2, 2023
bce6431
Implement cboard start and end dates (#93)
isaachan100 Jun 3, 2023
8860183
update organization shoutouts query (#94)
isaachan100 Jun 5, 2023
c766c93
Implement trending flyers logic (#95)
isaachan100 Jun 12, 2023
930960f
Fixed notification issue (#97)
vinnie4k Aug 22, 2023
86768bd
Flyer Notifications + Org/Flyer Model Changes (#99)
vinnie4k Sep 1, 2023
9ce89dd
Improve Search Algorithm (#101)
zachseidner1 Sep 10, 2023
d49b504
getFlyersByCategorySlug Query (#100)
vinnie4k Sep 12, 2023
b0976c5
Merge `vin/create-flyer` to `main` (#104)
vinnie4k Sep 13, 2023
d43a4f5
Trendiness Update and Migration Script for New Flyers Model (#106)
zachseidner1 Sep 14, 2023
cc16b13
Zach/trendiness and migration hot fix (#107)
zachseidner1 Sep 14, 2023
ed241dc
Micro PR for Flyers categorySlug migration (#108)
zachseidner1 Sep 20, 2023
ee2aed9
Create `editFlyer` mutation (#105)
vinnie4k Sep 26, 2023
221fe81
`checkAccessCode` query for Organization authentication (#109)
vinnie4k Sep 28, 2023
bf06c7d
Implemented getAllFlyerCategories and tests (#110)
cindy-x-liang Oct 2, 2023
5a0de53
Changing specifications for getFlyersBeforeDate and getFlyersAfterDat…
Aayush-Agnihotri Oct 4, 2023
31a508a
Cindy/flyer categories (#113)
cindy-x-liang Oct 4, 2023
47193d4
Increased HTTP request size (#114)
vinnie4k Oct 8, 2023
926eff8
Add error message (#116)
vinnie4k Oct 8, 2023
5df82ca
Update FlyerMiddleware.ts (#119)
vinnie4k Oct 15, 2023
3cf24c2
Update publications.json (#122)
jjennifergu Oct 23, 2023
889c4aa
Change Create Flyer route to use form data for image upload (#121)
zachseidner1 Oct 31, 2023
cf578dc
Merge remote-tracking branch 'origin/main' into release-copy
vinnie4k Nov 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Convert result of shuffling resolver to ArticleModel (#71)
  • Loading branch information
SashaLoayza authored Mar 25, 2023
commit ca89a00dfdaa82b7e46f9a749c792105e1d4a409
13 changes: 6 additions & 7 deletions src/repos/ArticleRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ const getShuffledArticlesByPublicationSlugs = async (
},
},
]).then((articles) => {
const articlesByPub = {};
for (const article of articles) {
articlesByPub[article._id] = article.articles.filter(
const filteredArticles = {};
for (const a of articles) {
filteredArticles[a._id] = a.articles.filter(
(article) => article !== null && !isArticleFiltered(article),
);
mostByOnePub = Math.max(mostByOnePub, articlesByPub[article._id].length);
mostByOnePub = Math.max(mostByOnePub, filteredArticles[a._id].length);
}
return articlesByPub;
return filteredArticles;
});

// take the ith element from each array in articlesByPub, add it to a list named ithArticles,
Expand All @@ -148,15 +148,14 @@ const getShuffledArticlesByPublicationSlugs = async (
const ithArticles = [];
for (const key of Object.keys(articlesByPub)) {
if (articlesByPub[key][i]) {
ithArticles.push(articlesByPub[key][i]);
ithArticles.push(new ArticleModel(articlesByPub[key][i])); // convert each article json object back to an ArticleModel object.
}
}
ithArticles.sort((a, b) => {
return b.date.getTime() - a.date.getTime();
});
shuffledArticles.push(...ithArticles);
}

return shuffledArticles;
};

Expand Down