Skip to content

Commit 7bc2ece

Browse files
committed
finish syncTester in PushBetaGroupsCommand
1 parent be36f09 commit 7bc2ece

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

Sources/AppStoreConnectCLI/Commands/TestFlight/BetaGroups/Sync/PushBetaGroupsCommand.swift

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct PushBetaGroupsCommand: CommonParsableCommand {
3333

3434
let localGroupWithTesters = try resourceProcessor.readGroupAndTesters()
3535

36-
localGroupWithTesters.forEach {
36+
try localGroupWithTesters.forEach {
3737
let localGroup = $0.betaGroup
3838
let localTesters = $0.testers
3939

@@ -46,7 +46,7 @@ struct PushBetaGroupsCommand: CommonParsableCommand {
4646
serverTesters: Set(serverTesters)
4747
)
4848

49-
processTesterStrategies(
49+
try processTesterStrategies(
5050
with: service,
5151
groupId: localGroup.id!,
5252
strategies: testerStrategies
@@ -74,11 +74,11 @@ struct PushBetaGroupsCommand: CommonParsableCommand {
7474
with service: AppStoreConnectService,
7575
groupId: String,
7676
strategies: [SyncStrategy<BetaTester>]
77-
) {
77+
) throws {
7878
let renderer = Renderers.SyncResultRenderer<BetaTester>()
7979

80-
strategies.forEach {
81-
syncTester(with: service, groupId: groupId, strategies: $0)
80+
try strategies.forEach {
81+
try syncTester(with: service, groupId: groupId, strategies: $0)
8282

8383
renderer.render($0, isDryRun: true)
8484
}
@@ -101,17 +101,19 @@ struct PushBetaGroupsCommand: CommonParsableCommand {
101101
with service: AppStoreConnectService,
102102
groupId: String,
103103
strategies: SyncStrategy<BetaTester>
104-
) {
104+
) throws {
105105
switch strategies {
106-
case .create(let tester):
107-
// TODO
108-
break
109-
case .update(let tester):
110-
// TODO
111-
break
112-
case .delete(let tester):
113-
// TODO
114-
break
106+
case .create(let tester):
107+
try service.inviteBetaTesterToGroups(
108+
firstName: tester.firstName,
109+
lastName: tester.lastName,
110+
email: tester.email!,
111+
groupIds: [groupId]
112+
)
113+
case .update(_):
114+
print("Update single beta tester is not supported")
115+
case .delete(let tester):
116+
try service.removeTesterFromGroups(email: tester.email!, groupIds: [groupId])
115117
}
116118
}
117119

0 commit comments

Comments
 (0)