Skip to content

Commit

Permalink
Cindy/flyer categories (#113)
Browse files Browse the repository at this point in the history
* Implemented  getAllFlyerCategories and tests

* update jest

* update jest

* implemented suggestions from zach, vin, and archit

* got rid of ESLint comment

* fixed names for tests

* Added loops to test cases

* Fixed test case to create flyers with the same category

* Changed 'push' to 'concat'

* Updated `getAllFlyerCategories`

---------

Co-authored-by: Cindy <cl2329@cornell.edu>
Co-authored-by: Vin Bui <vdb23@cornell.edu>
  • Loading branch information
3 people committed Oct 4, 2023
1 parent 5a0de53 commit 31a508a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/repos/FlyerRepo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const getFlyersByCategorySlug = async (
* @returns a list of Strings with all the category names.
*/
const getAllFlyerCategories = (): Promise<string[]> => {
return FlyerModel.collection.distinct('categorySlug');
return FlyerModel.find().distinct('categorySlug').exec();
};

const getFlyerByID = async (id: string): Promise<Flyer> => {
Expand Down

0 comments on commit 31a508a

Please sign in to comment.