From a5e9d02a9a1c32444bbeceb065c3f12d6fa9b853 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Mon, 16 Feb 2026 00:25:05 -0500 Subject: [PATCH] fix: Wrap admin subscriptions response to match frontend contract Frontend expects { subscriptions: [{ owner_email, module_name, license_id }] } but backend returned raw WebstoreSubscription entities. Shaped the response with license.owner join for owner_email and plan_id mapped to module_name. Co-Authored-By: Claude Opus 4.6 --- backend-nest/src/modules/admin/admin.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend-nest/src/modules/admin/admin.service.ts b/backend-nest/src/modules/admin/admin.service.ts index f46f958..ed6c6a9 100644 --- a/backend-nest/src/modules/admin/admin.service.ts +++ b/backend-nest/src/modules/admin/admin.service.ts @@ -151,10 +151,18 @@ export class AdminService { } async getSubscriptions() { - return this.webstoreSubRepo.find({ - relations: ['license'], + const subs = await this.webstoreSubRepo.find({ + relations: ['license', 'license.owner'], order: { created_at: 'DESC' }, }); + + return { + subscriptions: subs.map(sub => ({ + owner_email: sub.license?.owner?.email ?? 'Unknown', + module_name: sub.plan_id, + license_id: sub.license_id, + })), + }; } async getServers() {