feat: Delete Stripe pamyent connection

This commit is contained in:
Ahmed Bouhuolia
2024-09-22 21:57:46 +02:00
parent eb5fdbf4ee
commit 9ba651decb
4 changed files with 45 additions and 7 deletions

View File

@@ -124,10 +124,11 @@ function StripePaymentMethod() {
)}
</Group>
<Group spacing={10}>
<Button small onClick={handleEditBtnClick}>
Edit
</Button>
{isAccountActive && (
<Button small onClick={handleEditBtnClick}>
Edit
</Button>
)}
{!isAccountCreated && (
<Button intent={Intent.PRIMARY} small onClick={handleSetUpBtnClick}>
Set it Up

View File

@@ -20,7 +20,7 @@ export const useDeletePaymentMethod = (
return useMutation<void, Error, DeletePaymentMethodValues>(
({ paymentMethodId }) => {
return apiRequest
.delete(`/payment-methods/${paymentMethodId}`)
.delete(`/payment-services/${paymentMethodId}`)
.then((res) => res.data);
},
{ ...options },

View File

@@ -91,9 +91,11 @@ export const useDrawerActions = () => {
};
export const useAlertActions = () => {
const dispatch = useDispatch();
return {
openAlert: useDispatchAction(openAlert),
closeAlert: useDispatchAction(closeAlert),
openAlert: (name, payload) => dispatch(openAlert(name, payload)),
closeAlert: (name, payload) => dispatch(closeAlert(name, payload)),
};
};