diff --git a/src/controllers/newsletter.controller.js b/src/controllers/newsletter.controller.js index dca5a7fe..8146a325 100644 --- a/src/controllers/newsletter.controller.js +++ b/src/controllers/newsletter.controller.js @@ -224,9 +224,15 @@ exports.listSubscriptions = async (req, res) => { ...(options.source && { source: options.source }) }); + // Convert ObjectId to string for JSON serialization + const serializedSubscriptions = subscriptions.map(sub => ({ + ...sub, + _id: sub._id.toString() + })); + res.json({ success: true, - subscriptions, + subscriptions: serializedSubscriptions, pagination: { total, limit: options.limit,