Track HiveGrid Cloud planning reference
This commit is contained in:
1 parent
b3d5ea6764
commit
e341c5938a
5784 files changed
+1104929
-3
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import { useMatches } from "react-router";
|
||||
import { TenantUserType } from "~/application/enums/tenants/TenantUserType";
|
||||
import { TenantSimple } from "../db/tenants.db.server";
|
||||
import { TenantSubscriptionWithDetails } from "../db/tenantSubscriptions.db.server";
|
||||
import { AppOrAdminData } from "./useAppOrAdminData";
|
||||
import EntitiesSingleton from "~/modules/rows/repositories/EntitiesSingleton";
|
||||
|
||||
export type AppLoaderData = AppOrAdminData & {
|
||||
currentTenant: TenantSimple;
|
||||
mySubscription: TenantSubscriptionWithDetails | null;
|
||||
currentRole: TenantUserType;
|
||||
};
|
||||
|
||||
export function useAppData(): AppLoaderData {
|
||||
const paths: string[] = ["routes/app.$tenant", "routes/app"];
|
||||
const appData = (useMatches().find((f) => paths.includes(f.id.toLowerCase()))?.data ?? {}) as AppLoaderData;
|
||||
EntitiesSingleton.getInstance().setEntities(appData.entities);
|
||||
return appData;
|
||||
}
|
||||
Reference in new issue
Block a user