Skip to content

Commit

Permalink
fix: fix logic adding payment card and update decide user join reques…
Browse files Browse the repository at this point in the history
…t api
  • Loading branch information
mthinh committed Oct 11, 2024
1 parent 8be2ce1 commit 77ba3e7
Show file tree
Hide file tree
Showing 6 changed files with 385 additions and 599 deletions.
4 changes: 2 additions & 2 deletions lib/core/data/event/repository/event_repository_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class EventRepositoryImpl implements EventRepository {
if (result.hasException) {
return Left(Failure.withGqlException(result.exception));
}
return Right(result.parsedData?.decideUserJoinRequests ?? false);
return Right(result.parsedData?.decideUserJoinRequests.isNotEmpty == true);
}

@override
Expand All @@ -431,7 +431,7 @@ class EventRepositoryImpl implements EventRepository {
if (result.hasException) {
return Left(Failure.withGqlException(result.exception));
}
return Right(result.parsedData?.decideUserJoinRequests ?? false);
return Right(result.parsedData?.decideUserJoinRequests.isNotEmpty == true);
}

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class EventTicketsPaymentMethodPage extends StatelessWidget {
if (newCard != null) {
onCardAdded?.call(newCard);
}
AutoRouter.of(context).pop();
},
);
}
Expand All @@ -113,7 +114,14 @@ class EventTicketsPaymentMethodPage extends StatelessWidget {
),
),
if (selectedCard != null)
buyButton ?? const SizedBox.shrink(),
buyButton != null
? Padding(
padding: EdgeInsets.symmetric(
horizontal: Spacing.smMedium,
),
child: buyButton!,
)
: const SizedBox.shrink(),
],
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ class PayByStripeFooter extends StatelessWidget {
publishableKey: stripePublishableKey,
onCardAdded: onCardAdded,
onSelectCard: onSelectCard,
buyButton: PayButton(
disabled: disabled,
pricingInfo: pricingInfo,
selectedCurrency: selectedCurrency,
selectedNetwork: selectedNetwork,
isFree: isFree,
),
),
);
},
Expand All @@ -100,6 +107,7 @@ class PayByStripeFooter extends StatelessWidget {
pricingInfo: pricingInfo,
selectedCurrency: selectedCurrency,
selectedNetwork: selectedNetwork,
isFree: isFree,
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class EventJoinRequestNotificationItem extends StatelessWidget {
);
},
);
if (response.result?.parsedData?.decideUserJoinRequests == true) {
if (response.result?.parsedData?.decideUserJoinRequests.isNotEmpty ==
true) {
onRemove?.call();
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
mutation DecideUserJoinRequests($input: DecideUserJoinRequestsInput!) {
decideUserJoinRequests(input: $input)
decideUserJoinRequests(input: $input) {
_id
processed
}
}
Loading

0 comments on commit 77ba3e7

Please sign in to comment.