Skip to content

Commit 5f984b6

Browse files
sigurdmisoos
authored andcommitted
List uploaders in action package-info (dart-lang#8598)
1 parent 142d870 commit 5f984b6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/lib/admin/actions/package_info.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import 'package:pub_dev/package/backend.dart';
66

7+
import '../../account/backend.dart';
78
import 'actions.dart';
89

910
final packageInfo = AdminAction(
@@ -27,11 +28,20 @@ Loads and displays the package information.
2728
throw NotFoundException.resource(package);
2829
}
2930

31+
final uploaderIds = p.uploaders;
32+
List<String>? uploaderEmails;
33+
if (uploaderIds != null) {
34+
uploaderEmails = (await accountBackend.getEmailsOfUserIds(uploaderIds))
35+
.nonNulls
36+
.toList();
37+
}
38+
3039
return {
3140
'package': {
3241
'name': p.name,
3342
'created': p.created?.toIso8601String(),
3443
'publisherId': p.publisherId,
44+
'uploaders': uploaderEmails,
3545
'latestVersion': p.latestVersion,
3646
'isModerated': p.isModerated,
3747
if (p.moderatedAt != null)

app/test/admin/package_actions_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ void main() {
2323
'name': 'oxygen',
2424
'created': isNotEmpty,
2525
'publisherId': null,
26+
'uploaders': ['[email protected]'],
2627
'latestVersion': '1.2.0',
2728
'isModerated': false,
2829
}

0 commit comments

Comments
 (0)