mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
fix(projects): fetch projects if the feature was enabled.
This commit is contained in:
@@ -24,6 +24,7 @@ function MakeJournalProvider({ journalId, query, ...props }) {
|
||||
// Features guard.
|
||||
const { featureCan } = useFeatureCan();
|
||||
const isBranchFeatureCan = featureCan(Features.Branches);
|
||||
const isProjectFeatureCan = featureCan(Features.Projects);
|
||||
|
||||
// Load the accounts list.
|
||||
const { data: accounts, isLoading: isAccountsLoading } = useAccounts();
|
||||
@@ -60,7 +61,7 @@ function MakeJournalProvider({ journalId, query, ...props }) {
|
||||
const {
|
||||
data: { projects },
|
||||
isLoading: isProjectsLoading,
|
||||
} = useProjects();
|
||||
} = useProjects({}, { enabled: !!isProjectFeatureCan });
|
||||
|
||||
// Submit form payload.
|
||||
const [submitPayload, setSubmitPayload] = useState({});
|
||||
|
||||
Reference in New Issue
Block a user