From ed241dc47310a3edd2f78158909a26e301b67d1b Mon Sep 17 00:00:00 2001 From: Zachary Seidner <58796478+zachseidner1@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:51:08 -0400 Subject: [PATCH] Micro PR for Flyers categorySlug migration (#108) * Add migration script to update data based on new Flyers schema * Update Flyer trendiness * Fix comments * Clean up syntax for get trending flyers * Remove unnecessary createSpecificsByIndex function * Fix TypeScript compilation error * Update migration script to account for category slug * Fix formatting for flyers test --- migrations/update-flyers-model.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/migrations/update-flyers-model.js b/migrations/update-flyers-model.js index 836f935..dab9a54 100644 --- a/migrations/update-flyers-model.js +++ b/migrations/update-flyers-model.js @@ -9,6 +9,7 @@ module.exports = { $set: { organization: { $first: '$organizations' }, organizationSlug: { $first: '$organizationSlugs' }, + categorySlug: { $first: '$organizations.categorySlug' }, }, }, { @@ -31,7 +32,7 @@ module.exports = { }, }, { - $unset: ['organization', 'organizationSlug'], + $unset: ['organization', 'organizationSlug', 'categorySlug'], }, ]); },