warqadui 0.0.77 → 0.0.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +54 -3
- package/dist/index.d.ts +54 -3
- package/dist/index.js +13 -5
- package/dist/index.mjs +13 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -999,12 +999,39 @@ type AccountData = {
|
|
|
999
999
|
phoneNumber: string;
|
|
1000
1000
|
type: AccountType;
|
|
1001
1001
|
};
|
|
1002
|
+
type BranchesContext = {
|
|
1003
|
+
branches?: {
|
|
1004
|
+
_id: string;
|
|
1005
|
+
name: string;
|
|
1006
|
+
type: string;
|
|
1007
|
+
logo: string;
|
|
1008
|
+
contact: {
|
|
1009
|
+
phoneNumber: string;
|
|
1010
|
+
email: string;
|
|
1011
|
+
};
|
|
1012
|
+
address: {
|
|
1013
|
+
location: string;
|
|
1014
|
+
city: string;
|
|
1015
|
+
};
|
|
1016
|
+
features: {
|
|
1017
|
+
stockTracking: boolean;
|
|
1018
|
+
moneyTracking: boolean;
|
|
1019
|
+
};
|
|
1020
|
+
isActive: boolean;
|
|
1021
|
+
by: {
|
|
1022
|
+
name: string;
|
|
1023
|
+
};
|
|
1024
|
+
createdAt: string;
|
|
1025
|
+
}[];
|
|
1026
|
+
};
|
|
1002
1027
|
type AuthState = {
|
|
1003
1028
|
auth: AuthData | null;
|
|
1004
1029
|
account: AccountData | null;
|
|
1030
|
+
branches: BranchesContext["branches"] | null;
|
|
1005
1031
|
isLoggedIn: boolean;
|
|
1006
1032
|
isFetched: boolean;
|
|
1007
|
-
setAuth: (auth: AuthData, account: AccountData) => void;
|
|
1033
|
+
setAuth: (auth: AuthData, account: AccountData, branches?: BranchesContext["branches"]) => void;
|
|
1034
|
+
setBranches: (branches: BranchesContext["branches"]) => void;
|
|
1008
1035
|
setIsLoggedIn: (isLoggedIn: boolean) => void;
|
|
1009
1036
|
setIsFetched: (isFetched: boolean) => void;
|
|
1010
1037
|
logout: () => void;
|
|
@@ -1044,6 +1071,29 @@ declare const useAuth: () => {
|
|
|
1044
1071
|
phoneNumber: string;
|
|
1045
1072
|
type: AccountType;
|
|
1046
1073
|
} | null;
|
|
1074
|
+
branches: {
|
|
1075
|
+
_id: string;
|
|
1076
|
+
name: string;
|
|
1077
|
+
type: string;
|
|
1078
|
+
logo: string;
|
|
1079
|
+
contact: {
|
|
1080
|
+
phoneNumber: string;
|
|
1081
|
+
email: string;
|
|
1082
|
+
};
|
|
1083
|
+
address: {
|
|
1084
|
+
location: string;
|
|
1085
|
+
city: string;
|
|
1086
|
+
};
|
|
1087
|
+
features: {
|
|
1088
|
+
stockTracking: boolean;
|
|
1089
|
+
moneyTracking: boolean;
|
|
1090
|
+
};
|
|
1091
|
+
isActive: boolean;
|
|
1092
|
+
by: {
|
|
1093
|
+
name: string;
|
|
1094
|
+
};
|
|
1095
|
+
createdAt: string;
|
|
1096
|
+
}[] | null | undefined;
|
|
1047
1097
|
isLoggedIn: boolean;
|
|
1048
1098
|
isFetched: boolean;
|
|
1049
1099
|
role: string | undefined;
|
|
@@ -1076,7 +1126,8 @@ declare const useAuth: () => {
|
|
|
1076
1126
|
email: string;
|
|
1077
1127
|
phoneNumber: string;
|
|
1078
1128
|
type: AccountType;
|
|
1079
|
-
}) => void;
|
|
1129
|
+
}, branches?: BranchesContext["branches"]) => void;
|
|
1130
|
+
setBranches: (branches: BranchesContext["branches"]) => void;
|
|
1080
1131
|
login: (data: any) => void;
|
|
1081
1132
|
updateAuth: (data: Partial<{
|
|
1082
1133
|
_id: string;
|
|
@@ -1231,4 +1282,4 @@ type updateUserEmailSchemaType = z$1.infer<typeof updateUserEmailSchema>;
|
|
|
1231
1282
|
type resetPasswordSchemaType = z$1.infer<typeof resetPasswordSchema>;
|
|
1232
1283
|
type createUserSchemaType = z$1.infer<typeof createUserSchema>;
|
|
1233
1284
|
|
|
1234
|
-
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
|
1285
|
+
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
package/dist/index.d.ts
CHANGED
|
@@ -999,12 +999,39 @@ type AccountData = {
|
|
|
999
999
|
phoneNumber: string;
|
|
1000
1000
|
type: AccountType;
|
|
1001
1001
|
};
|
|
1002
|
+
type BranchesContext = {
|
|
1003
|
+
branches?: {
|
|
1004
|
+
_id: string;
|
|
1005
|
+
name: string;
|
|
1006
|
+
type: string;
|
|
1007
|
+
logo: string;
|
|
1008
|
+
contact: {
|
|
1009
|
+
phoneNumber: string;
|
|
1010
|
+
email: string;
|
|
1011
|
+
};
|
|
1012
|
+
address: {
|
|
1013
|
+
location: string;
|
|
1014
|
+
city: string;
|
|
1015
|
+
};
|
|
1016
|
+
features: {
|
|
1017
|
+
stockTracking: boolean;
|
|
1018
|
+
moneyTracking: boolean;
|
|
1019
|
+
};
|
|
1020
|
+
isActive: boolean;
|
|
1021
|
+
by: {
|
|
1022
|
+
name: string;
|
|
1023
|
+
};
|
|
1024
|
+
createdAt: string;
|
|
1025
|
+
}[];
|
|
1026
|
+
};
|
|
1002
1027
|
type AuthState = {
|
|
1003
1028
|
auth: AuthData | null;
|
|
1004
1029
|
account: AccountData | null;
|
|
1030
|
+
branches: BranchesContext["branches"] | null;
|
|
1005
1031
|
isLoggedIn: boolean;
|
|
1006
1032
|
isFetched: boolean;
|
|
1007
|
-
setAuth: (auth: AuthData, account: AccountData) => void;
|
|
1033
|
+
setAuth: (auth: AuthData, account: AccountData, branches?: BranchesContext["branches"]) => void;
|
|
1034
|
+
setBranches: (branches: BranchesContext["branches"]) => void;
|
|
1008
1035
|
setIsLoggedIn: (isLoggedIn: boolean) => void;
|
|
1009
1036
|
setIsFetched: (isFetched: boolean) => void;
|
|
1010
1037
|
logout: () => void;
|
|
@@ -1044,6 +1071,29 @@ declare const useAuth: () => {
|
|
|
1044
1071
|
phoneNumber: string;
|
|
1045
1072
|
type: AccountType;
|
|
1046
1073
|
} | null;
|
|
1074
|
+
branches: {
|
|
1075
|
+
_id: string;
|
|
1076
|
+
name: string;
|
|
1077
|
+
type: string;
|
|
1078
|
+
logo: string;
|
|
1079
|
+
contact: {
|
|
1080
|
+
phoneNumber: string;
|
|
1081
|
+
email: string;
|
|
1082
|
+
};
|
|
1083
|
+
address: {
|
|
1084
|
+
location: string;
|
|
1085
|
+
city: string;
|
|
1086
|
+
};
|
|
1087
|
+
features: {
|
|
1088
|
+
stockTracking: boolean;
|
|
1089
|
+
moneyTracking: boolean;
|
|
1090
|
+
};
|
|
1091
|
+
isActive: boolean;
|
|
1092
|
+
by: {
|
|
1093
|
+
name: string;
|
|
1094
|
+
};
|
|
1095
|
+
createdAt: string;
|
|
1096
|
+
}[] | null | undefined;
|
|
1047
1097
|
isLoggedIn: boolean;
|
|
1048
1098
|
isFetched: boolean;
|
|
1049
1099
|
role: string | undefined;
|
|
@@ -1076,7 +1126,8 @@ declare const useAuth: () => {
|
|
|
1076
1126
|
email: string;
|
|
1077
1127
|
phoneNumber: string;
|
|
1078
1128
|
type: AccountType;
|
|
1079
|
-
}) => void;
|
|
1129
|
+
}, branches?: BranchesContext["branches"]) => void;
|
|
1130
|
+
setBranches: (branches: BranchesContext["branches"]) => void;
|
|
1080
1131
|
login: (data: any) => void;
|
|
1081
1132
|
updateAuth: (data: Partial<{
|
|
1082
1133
|
_id: string;
|
|
@@ -1231,4 +1282,4 @@ type updateUserEmailSchemaType = z$1.infer<typeof updateUserEmailSchema>;
|
|
|
1231
1282
|
type resetPasswordSchemaType = z$1.infer<typeof resetPasswordSchema>;
|
|
1232
1283
|
type createUserSchemaType = z$1.infer<typeof createUserSchema>;
|
|
1233
1284
|
|
|
1234
|
-
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
|
1285
|
+
export { AccountForm, type AccountType, Accounts, AdminProtectedRoute, Badge, type BadgeProps, type BranchesContext, Branding, type BrandingProps, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CategoryCard, type CategoryItem, ClassicSpin, CodeBlock, ConfirmModal, type ConfirmModalProps, type CreateAccountSchemaType, DashboardLayout, DataTable, type DataTableColumn, DateInput, type DateInputProps, type DeleteFunction, Dropdown, type DropdownItem, type DropdownProps, type FetchFunction, type FetchProps, Fields, Guard, InfoGrid, Input, type InputProps, LinkUser, LoadingBox, LoadingSpin, type LoginSchema, type LoginTheme, Modal, type ModalProps, type NavItem, type NavItems, type Option, OverlaySpin, PageA4, PageHeader, type PdfOptions, PhoneInput, type PhoneInputProps, type PostFunction, PostTable, type PostTableActions, type PostTableChangeParams, ProfileCard, type ProfileCardProps, ProfileDropdown, type ProfileDropdownItem, type ProfileDropdownProps, ProfilePage, ProfileView, type ProfileViewInfoItem, type ProfileViewProps, ProtectedRoute, type PutFunction, ResetPasswordPage, type Role, SearchApi, SearchApiContent, SearchApiInput, SearchApiItem, type SearchApiProps, SearchApiTrigger, Select, SelectContent, SelectItem, type SelectProps, SelectTrigger, SimpleTable, type SimpleTableColumn, type StorageManager, type StoreConfig, Textarea, type TextareaProps, type ThemeConfig, ThemeProvider, ThemeToggle, ThemedLogin, UnProtectedRoute, type UseModalReturn, UserForm, UserProfile, Users, Views, type WarqadConfig, type WarqadConfigContextType, WarqadProvider, createAccountSchema, createUserSchema, type createUserSchemaType, generatePdf, linkUserSchema, type linkUserSchemaType, resetPasswordSchema, type resetPasswordSchemaType, storage, updateUserEmailSchema, type updateUserEmailSchemaType, useA4CategoryView, useA4StatementView, useAntdImageUpload, useApi, useApp, useAuth, useAuthStore, useLogin, useModal, useSearchApiContext, useSelectContext, useTheme, useTransaction, useWarqadConfig, verifyUserEmailSchema, type verifyUserEmailSchemaType };
|
package/dist/index.js
CHANGED
|
@@ -7851,18 +7851,22 @@ var import_zustand = require("zustand");
|
|
|
7851
7851
|
var useAuthStore = (0, import_zustand.create)((set, get) => ({
|
|
7852
7852
|
auth: null,
|
|
7853
7853
|
account: null,
|
|
7854
|
+
branches: null,
|
|
7854
7855
|
isLoggedIn: false,
|
|
7855
7856
|
isFetched: false,
|
|
7856
|
-
setAuth: (auth, account) => set({
|
|
7857
|
+
setAuth: (auth, account, branches) => set({
|
|
7857
7858
|
auth,
|
|
7858
7859
|
account,
|
|
7860
|
+
branches: branches || null,
|
|
7859
7861
|
isLoggedIn: true
|
|
7860
7862
|
}),
|
|
7863
|
+
setBranches: (branches) => set({ branches }),
|
|
7861
7864
|
setIsLoggedIn: (isLoggedIn) => set({ isLoggedIn }),
|
|
7862
7865
|
setIsFetched: (isFetched) => set({ isFetched }),
|
|
7863
7866
|
logout: () => set({
|
|
7864
7867
|
auth: null,
|
|
7865
7868
|
account: null,
|
|
7869
|
+
branches: null,
|
|
7866
7870
|
isLoggedIn: false,
|
|
7867
7871
|
isFetched: true
|
|
7868
7872
|
}),
|
|
@@ -7879,12 +7883,14 @@ var useAuthStore = (0, import_zustand.create)((set, get) => ({
|
|
|
7879
7883
|
var useAuth = () => {
|
|
7880
7884
|
const auth = useAuthStore((state) => state.auth);
|
|
7881
7885
|
const account = useAuthStore((state) => state.account);
|
|
7886
|
+
const branches = useAuthStore((state) => state.branches);
|
|
7882
7887
|
const isLoggedIn = useAuthStore((state) => state.isLoggedIn);
|
|
7883
7888
|
const isFetched = useAuthStore((state) => state.isFetched);
|
|
7884
7889
|
const setIsLoggedIn = useAuthStore((state) => state.setIsLoggedIn);
|
|
7885
7890
|
const setIsFetched = useAuthStore((state) => state.setIsFetched);
|
|
7886
7891
|
const logout = useAuthStore((state) => state.logout);
|
|
7887
7892
|
const setAuth = useAuthStore((state) => state.setAuth);
|
|
7893
|
+
const setBranches = useAuthStore((state) => state.setBranches);
|
|
7888
7894
|
const updateAuth = useAuthStore((state) => state.updateAuth);
|
|
7889
7895
|
const updateAccount = useAuthStore((state) => state.updateAccount);
|
|
7890
7896
|
const hasPermission = useAuthStore((state) => state.hasPermission);
|
|
@@ -7894,6 +7900,7 @@ var useAuth = () => {
|
|
|
7894
7900
|
user: auth,
|
|
7895
7901
|
// Alias for 'auth'
|
|
7896
7902
|
account,
|
|
7903
|
+
branches,
|
|
7897
7904
|
isLoggedIn,
|
|
7898
7905
|
isFetched,
|
|
7899
7906
|
// ----- Shorthand Accessors -----
|
|
@@ -7914,13 +7921,14 @@ var useAuth = () => {
|
|
|
7914
7921
|
setIsLoggedIn,
|
|
7915
7922
|
setIsFetched,
|
|
7916
7923
|
setAuth,
|
|
7924
|
+
setBranches,
|
|
7917
7925
|
login: (data) => {
|
|
7918
7926
|
if (data?.auth && data?.account) {
|
|
7919
|
-
setAuth(data.auth, data.account);
|
|
7927
|
+
setAuth(data.auth, data.account, data.branches);
|
|
7920
7928
|
} else if (data?.user && data?.account) {
|
|
7921
|
-
setAuth(data.user, data.account);
|
|
7929
|
+
setAuth(data.user, data.account, data.branches);
|
|
7922
7930
|
} else {
|
|
7923
|
-
setAuth(data, data?.account || data);
|
|
7931
|
+
setAuth(data, data?.account || data, data?.branches);
|
|
7924
7932
|
}
|
|
7925
7933
|
},
|
|
7926
7934
|
updateAuth,
|
|
@@ -9316,7 +9324,7 @@ var UserProfile = ({
|
|
|
9316
9324
|
{
|
|
9317
9325
|
label: "My Profile",
|
|
9318
9326
|
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_lucide_react22.User, { size: 18 }),
|
|
9319
|
-
onClick: () => navigate("
|
|
9327
|
+
onClick: () => navigate("profile"),
|
|
9320
9328
|
className: "min-w-[150px]"
|
|
9321
9329
|
},
|
|
9322
9330
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -7818,18 +7818,22 @@ import { create } from "zustand";
|
|
|
7818
7818
|
var useAuthStore = create((set, get) => ({
|
|
7819
7819
|
auth: null,
|
|
7820
7820
|
account: null,
|
|
7821
|
+
branches: null,
|
|
7821
7822
|
isLoggedIn: false,
|
|
7822
7823
|
isFetched: false,
|
|
7823
|
-
setAuth: (auth, account) => set({
|
|
7824
|
+
setAuth: (auth, account, branches) => set({
|
|
7824
7825
|
auth,
|
|
7825
7826
|
account,
|
|
7827
|
+
branches: branches || null,
|
|
7826
7828
|
isLoggedIn: true
|
|
7827
7829
|
}),
|
|
7830
|
+
setBranches: (branches) => set({ branches }),
|
|
7828
7831
|
setIsLoggedIn: (isLoggedIn) => set({ isLoggedIn }),
|
|
7829
7832
|
setIsFetched: (isFetched) => set({ isFetched }),
|
|
7830
7833
|
logout: () => set({
|
|
7831
7834
|
auth: null,
|
|
7832
7835
|
account: null,
|
|
7836
|
+
branches: null,
|
|
7833
7837
|
isLoggedIn: false,
|
|
7834
7838
|
isFetched: true
|
|
7835
7839
|
}),
|
|
@@ -7846,12 +7850,14 @@ var useAuthStore = create((set, get) => ({
|
|
|
7846
7850
|
var useAuth = () => {
|
|
7847
7851
|
const auth = useAuthStore((state) => state.auth);
|
|
7848
7852
|
const account = useAuthStore((state) => state.account);
|
|
7853
|
+
const branches = useAuthStore((state) => state.branches);
|
|
7849
7854
|
const isLoggedIn = useAuthStore((state) => state.isLoggedIn);
|
|
7850
7855
|
const isFetched = useAuthStore((state) => state.isFetched);
|
|
7851
7856
|
const setIsLoggedIn = useAuthStore((state) => state.setIsLoggedIn);
|
|
7852
7857
|
const setIsFetched = useAuthStore((state) => state.setIsFetched);
|
|
7853
7858
|
const logout = useAuthStore((state) => state.logout);
|
|
7854
7859
|
const setAuth = useAuthStore((state) => state.setAuth);
|
|
7860
|
+
const setBranches = useAuthStore((state) => state.setBranches);
|
|
7855
7861
|
const updateAuth = useAuthStore((state) => state.updateAuth);
|
|
7856
7862
|
const updateAccount = useAuthStore((state) => state.updateAccount);
|
|
7857
7863
|
const hasPermission = useAuthStore((state) => state.hasPermission);
|
|
@@ -7861,6 +7867,7 @@ var useAuth = () => {
|
|
|
7861
7867
|
user: auth,
|
|
7862
7868
|
// Alias for 'auth'
|
|
7863
7869
|
account,
|
|
7870
|
+
branches,
|
|
7864
7871
|
isLoggedIn,
|
|
7865
7872
|
isFetched,
|
|
7866
7873
|
// ----- Shorthand Accessors -----
|
|
@@ -7881,13 +7888,14 @@ var useAuth = () => {
|
|
|
7881
7888
|
setIsLoggedIn,
|
|
7882
7889
|
setIsFetched,
|
|
7883
7890
|
setAuth,
|
|
7891
|
+
setBranches,
|
|
7884
7892
|
login: (data) => {
|
|
7885
7893
|
if (data?.auth && data?.account) {
|
|
7886
|
-
setAuth(data.auth, data.account);
|
|
7894
|
+
setAuth(data.auth, data.account, data.branches);
|
|
7887
7895
|
} else if (data?.user && data?.account) {
|
|
7888
|
-
setAuth(data.user, data.account);
|
|
7896
|
+
setAuth(data.user, data.account, data.branches);
|
|
7889
7897
|
} else {
|
|
7890
|
-
setAuth(data, data?.account || data);
|
|
7898
|
+
setAuth(data, data?.account || data, data?.branches);
|
|
7891
7899
|
}
|
|
7892
7900
|
},
|
|
7893
7901
|
updateAuth,
|
|
@@ -9283,7 +9291,7 @@ var UserProfile = ({
|
|
|
9283
9291
|
{
|
|
9284
9292
|
label: "My Profile",
|
|
9285
9293
|
icon: /* @__PURE__ */ jsx52(User2, { size: 18 }),
|
|
9286
|
-
onClick: () => navigate("
|
|
9294
|
+
onClick: () => navigate("profile"),
|
|
9287
9295
|
className: "min-w-[150px]"
|
|
9288
9296
|
},
|
|
9289
9297
|
{
|