fix: Wrap admin subscriptions response to match frontend contract
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
All checks were successful
Test Asgard Runner / test (push) Successful in 3s
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user