From 1cdd1d9bcdba23b68dd6a5494d9bb1c85b83950b Mon Sep 17 00:00:00 2001 From: Aydan Pirani Date: Wed, 10 Apr 2024 23:26:16 -0500 Subject: [PATCH] minor change to subscription format --- src/services/subscription/subscription-router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/subscription/subscription-router.ts b/src/services/subscription/subscription-router.ts index 6806ab3..d847061 100644 --- a/src/services/subscription/subscription-router.ts +++ b/src/services/subscription/subscription-router.ts @@ -10,8 +10,8 @@ subscriptionRouter.post("/", async (req, res, next) => { try { const subscriptionData = SubscriptionValidator.parse(req.body); await Database.SUBSCRIPTION.findOneAndUpdate( - { email: subscriptionData.email }, { mailingList: subscriptionData.mailingList }, + { $push: { subscriptions: data.email } }, { upsert: true, new: true } ); return res.status(StatusCodes.CREATED).json(subscriptionData);