Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: identify APIs that can be moved to parent component #770

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export function UpcomingPlanChangeBanner({
async (planId: string) => {
setIsPlanLoading(true);
try {
// This API call can be moved to sdks/js/packages/core/react/components/organization/billing/index.tsx
const resp = await client?.frontierServiceGetPlan(planId);
const plan = resp?.data?.plan ?? {};
if (plan) {
Expand Down Expand Up @@ -95,6 +96,7 @@ export function UpcomingPlanChangeBanner({
setIsPlanChangeLoading(true);
try {
if (activeOrganization?.id && billingAccount?.id && subscription?.id) {
// This API call can be moved to sdks/js/packages/core/react/components/organization/billing/index.tsx
const resp = await client?.frontierServiceChangeSubscription(
activeOrganization?.id,
billingAccount?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const PaymentMethod = ({
isAllowed,
hideUpdatePaymentMethodBtn = false
}: PaymentMethodProps) => {
// This is duplicated in the parent component sdks/js/packages/core/react/components/organization/billing/index.tsx
const { client, config, billingAccount } = useFrontier();
const [isActionLoading, setIsActionLoading] = useState(false);
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const UpcomingBillingCycle = ({
isPermissionLoading
}: UpcomingBillingCycleProps) => {
const [upcomingInvoice, setUpcomingInvoice] = useState<V1Beta1Invoice>();
// This hook call is duplicated in parent sdks/js/packages/core/react/components/organization/billing/index.tsx
const {
client,
billingAccount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export const GeneralOrganization = ({
if (!client) return;
if (!organization?.id) return;

// This API call can be moved to sdks/js/packages/core/react/components/organization/general/index.tsx
try {
const resp = await client.frontierServiceUpdateOrganization(
organization?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ export default function ConfirmPlanChange() {
client,
fetchActiveSubsciption,
activeSubscription,
basePlan,
allPlans
basePlan
} = useFrontier();
const [newPlan, setNewPlan] = useState<V1Beta1Plan>();
const [isNewPlanLoading, setIsNewPlanLoading] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const UpdateProfile = () => {
if (!client) return;
if (!user?.id) return;

// This API call can be moved to sdks/js/packages/core/react/components/organization/user/index.tsx
const updatedUser = await client.frontierServiceUpdateCurrentUser(data);
if (updatedUser?.data?.user) {
setUser(updatedUser?.data?.user);
Expand Down
Loading