Skip to content

Commit

Permalink
issue 409, shoud not get Invoices in self-hosted system
Browse files Browse the repository at this point in the history
  • Loading branch information
xquanluu authored and Quan HL committed Mar 19, 2024
1 parent 8be61dd commit 1ce1993
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/containers/internal/views/accounts/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -85,7 +86,10 @@ export const AccountForm = ({
const user = useSelectState("user");
const currentServiceProvider = useSelectState("currentServiceProvider");
const [accounts] = useApiData<Account[]>("Accounts");
const [invoice] = useApiData<Invoice>("Invoices");
// Dont get Invoices if the environment is self-hosted
const [invoice] = STRIPE_PUBLISHABLE_KEY
? useApiData<Invoice>("Invoices")
: [undefined];
const [userData] = useApiData<CurrentUserData>("Users/me");
const [userCarriers] = useApiData<Carrier[]>(`VoipCarriers`);
const [userSpeechs] = useApiData<SpeechCredential[]>(
Expand Down

0 comments on commit 1ce1993

Please sign in to comment.