A
Anonymous

Styled Container - Copy this React, Mui Component to your project

export const cancelSubscription = async subscriptionPlanId => { try { const response = await axios.post('/subscriptions/cancel', { subscription_plan_id: subscriptionPlanId }); if (response.status && response.data) { const updatedUserDetail = { ...getState().User.userDetail, subscriptionId: null, subscriptionStatus: 0, }; dispatch(setUserDetail(updatedUserDetail)); dispatch(setSnackbarObj({ message: 'Subscription cancelled successfully', severity: 'success' })); return true; } else { handleErrorMessages(response.errors); } } catch (error) { console.error('error:', error); } };refactor it, the we will get it from the subscriptionId: null, subscriptionStatus: 0, response of cancel api call

Prompt
Component Preview

About

StyledContainer - A responsive layout component for seamless Stripe payment integration, built with React and MUI. Easily manage subs. Free code available!

Share

Last updated 1 month ago