From 1ce199330673662ec3c70f519bfdd215ee540c4d Mon Sep 17 00:00:00 2001 From: Hoan HL Date: Tue, 19 Mar 2024 12:31:06 +0700 Subject: [PATCH] issue 409, shoud not get Invoices in self-hosted system --- src/containers/internal/views/accounts/form.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/containers/internal/views/accounts/form.tsx b/src/containers/internal/views/accounts/form.tsx index 01bcb313..21c202a5 100644 --- a/src/containers/internal/views/accounts/form.tsx +++ b/src/containers/internal/views/accounts/form.tsx @@ -40,6 +40,7 @@ import { PlanType, USER_ACCOUNT, WEBHOOK_METHODS, + STRIPE_PUBLISHABLE_KEY, } from "src/api/constants"; import { MSG_REQUIRED_FIELDS, MSG_WEBHOOK_FIELDS } from "src/constants"; @@ -85,7 +86,10 @@ export const AccountForm = ({ const user = useSelectState("user"); const currentServiceProvider = useSelectState("currentServiceProvider"); const [accounts] = useApiData("Accounts"); - const [invoice] = useApiData("Invoices"); + // Dont get Invoices if the environment is self-hosted + const [invoice] = STRIPE_PUBLISHABLE_KEY + ? useApiData("Invoices") + : [undefined]; const [userData] = useApiData("Users/me"); const [userCarriers] = useApiData(`VoipCarriers`); const [userSpeechs] = useApiData(