fixed some ui, upgrade functionalitym added permission to operator
This commit is contained in:
@@ -72,8 +72,10 @@ export const usersApi = {
|
||||
/** GET /users — backend filters by `username` */
|
||||
getUsers: async (params: UsersListParams = {}, signal?: AbortSignal): Promise<UsersListResponse> => {
|
||||
const { page, limit, search, isActive } = params;
|
||||
const queryParams: Record<string, string | number | undefined> = { page, limit, isActive };
|
||||
if (search) queryParams.username = search;
|
||||
const { data } = await apiClient.get<UsersListResponse>("/users", {
|
||||
params: { page, limit, username: search, isActive },
|
||||
params: queryParams,
|
||||
signal,
|
||||
});
|
||||
return data;
|
||||
|
||||
@@ -151,13 +151,13 @@ export function CardBalanceForm({ mode, initialData }: CardBalanceFormProps) {
|
||||
label={t("Passport number", "Pasport belgisi")}
|
||||
value={form.passportNumber}
|
||||
onChange={setString("passportNumber")}
|
||||
placeholder={t("Passport number", "Pasport belgisi")}
|
||||
placeholder="999999"
|
||||
error={errMsg(errors.passportNumber)}
|
||||
required
|
||||
/>
|
||||
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number", "Kart belgisi")}
|
||||
value={form.cardNumber}
|
||||
onChange={setString("cardNumber")}
|
||||
|
||||
@@ -138,12 +138,12 @@ function StepCard({ form, errors, set, t, cardTypeOptions, branchOptions, distri
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("cardPin.field.cardNumber", "Kart belgisi")}
|
||||
required
|
||||
value={form.cardNumber}
|
||||
onChange={(v) => set("cardNumber", v)}
|
||||
placeholder={t("cardPin.field.cardNumber", "Kart belgisi")}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.cardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
@@ -317,12 +317,12 @@ function StepPassport({ form, errors, set, t }: StepContentProps) {
|
||||
error={errors.passportSerie}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("cardPin.field.passportId", "Pasport belgisi")}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("cardPin.field.passportId", "Pasport belgisi")}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -258,7 +258,7 @@ function StepCard({ form, errors, set, t, initialData, userLocked, selfUserId, u
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("cardRequisiteForm.labels.cardNumber") || "Kart belgisi"}
|
||||
value={form.cardNumber}
|
||||
onChange={(v) => set("cardNumber", v)}
|
||||
@@ -439,12 +439,12 @@ function StepPassport({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -683,7 +683,8 @@ export function CardRequisiteForm({ mode, initialData }: CardRequisiteFormProps)
|
||||
onNext={!isLastStep ? handleNext : undefined}
|
||||
nextLabel={t("Next", "Indiki")}
|
||||
showSubmit={isLastStep}
|
||||
onSubmit={isLastStep ? handleSubmit : undefined}
|
||||
saveOnEveryStep={mode === "edit"}
|
||||
onSubmit={handleSubmit}
|
||||
submitLabel={
|
||||
mode === "create"
|
||||
? t("Create card requisite order", "Kart rekwiziti üçin sargyt dörediň")
|
||||
|
||||
@@ -27,6 +27,8 @@ interface CardTransactionFormProps {
|
||||
|
||||
type FlatErrors = Partial<Record<keyof CardTransactionFormData, string>>;
|
||||
|
||||
type CardiacTransactionLoose = Partial<Record<keyof CardTransactionFormData, string>>;
|
||||
|
||||
function flattenErrors(errors: Record<string, { message?: string } | undefined>): FlatErrors {
|
||||
const result: FlatErrors = {};
|
||||
for (const key of Object.keys(errors)) {
|
||||
@@ -92,18 +94,43 @@ export function CardTransactionForm({ mode, initialData }: CardTransactionFormPr
|
||||
defaultValues: initialData
|
||||
? {
|
||||
...DEFAULT_FORM_VALUES,
|
||||
number: initialData.number,
|
||||
name: initialData.name,
|
||||
type: initialData.type,
|
||||
month: initialData.month,
|
||||
year: initialData.year,
|
||||
number: initialData.number ?? "",
|
||||
name: initialData.name ?? "",
|
||||
type: initialData.type ?? "",
|
||||
month: initialData.month ?? "",
|
||||
year: initialData.year ?? "",
|
||||
userId: userLocked ? selfUserId : String(initialData.user?.id ?? ""),
|
||||
}
|
||||
: { ...DEFAULT_FORM_VALUES, userId: selfUserId },
|
||||
});
|
||||
|
||||
const form = watch();
|
||||
const errors = useMemo(() => flattenErrors(rhfErrors as Record<string, { message?: string } | undefined>), [rhfErrors]);
|
||||
|
||||
// Live schema errors, only surfaced once the user attempts to submit, so
|
||||
// required-field warnings reliably show under fields (avoids RHF setError
|
||||
// snapshot timing; mirrors the step-based forms' submitted validation).
|
||||
const [submitAttempted, setSubmitAttempted] = useState(false);
|
||||
|
||||
const liveErrors = useMemo<FlatErrors>(() => {
|
||||
if (!submitAttempted) return {};
|
||||
const normalized: CardiacTransactionLoose = { ...DEFAULT_FORM_VALUES, ...form };
|
||||
for (const key of Object.keys(DEFAULT_FORM_VALUES) as (keyof CardTransactionFormData)[]) {
|
||||
if (normalized[key] == null) normalized[key] = "";
|
||||
}
|
||||
const parsed = cardTransactionFormSchema.safeParse(normalized);
|
||||
if (parsed.success) return {};
|
||||
const result: FlatErrors = {};
|
||||
for (const issue of parsed.error.issues) {
|
||||
const key = issue.path[0] as keyof CardTransactionFormData;
|
||||
result[key] = issue.message;
|
||||
}
|
||||
return result;
|
||||
}, [submitAttempted, form]);
|
||||
|
||||
const errors = useMemo(() => {
|
||||
const fromRHF = flattenErrors(rhfErrors as Record<string, { message?: string } | undefined>);
|
||||
return { ...fromRHF, ...liveErrors };
|
||||
}, [rhfErrors, liveErrors]);
|
||||
|
||||
const createMutation = useCreateCardTransaction();
|
||||
const updateMutation = useUpdateCardTransaction(initialData?.id ?? 0);
|
||||
@@ -118,8 +145,13 @@ export function CardTransactionForm({ mode, initialData }: CardTransactionFormPr
|
||||
const errMsg = (msg: string | undefined) => (!msg ? undefined : msg.startsWith("validation.") ? t(msg, msg) : msg);
|
||||
|
||||
const handleSubmit = async () => {
|
||||
const result = cardTransactionFormSchema.safeParse(getValues());
|
||||
const raw: CardiacTransactionLoose = { ...DEFAULT_FORM_VALUES, ...getValues() };
|
||||
for (const key of Object.keys(DEFAULT_FORM_VALUES) as (keyof CardTransactionFormData)[]) {
|
||||
if (raw[key] == null) raw[key] = "";
|
||||
}
|
||||
const result = cardTransactionFormSchema.safeParse(raw);
|
||||
if (!result.success) {
|
||||
setSubmitAttempted(true);
|
||||
for (const issue of result.error.issues) {
|
||||
const key = issue.path[0] as keyof CardTransactionFormData;
|
||||
setError(key, { message: issue.message });
|
||||
@@ -154,7 +186,7 @@ export function CardTransactionForm({ mode, initialData }: CardTransactionFormPr
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{/* Name */}
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Card name", "Kartyň ady")}
|
||||
value={form.name}
|
||||
onChange={setField("name")}
|
||||
@@ -177,11 +209,11 @@ export function CardTransactionForm({ mode, initialData }: CardTransactionFormPr
|
||||
|
||||
{/* Card Number */}
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number", "Kart belgisi")}
|
||||
value={form.number}
|
||||
onChange={setField("number")}
|
||||
placeholder={t("Card number", "Kart belgisi")}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errMsg(errors.number)}
|
||||
required
|
||||
/>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import apiClient from "@/lib/api/client";
|
||||
import type { LocalizedText } from "@/features/branches/api/branchesApi";
|
||||
|
||||
// ─── Types ────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -49,7 +50,7 @@ export interface ClientPermission {
|
||||
|
||||
export interface ClientBranch {
|
||||
id: number;
|
||||
name: string;
|
||||
name: LocalizedText | string;
|
||||
region: string;
|
||||
district: string;
|
||||
uniqueCode: string;
|
||||
|
||||
@@ -483,16 +483,16 @@ function StepCard({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.cardNumber}
|
||||
onChange={(v) => set("cardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.cardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.cardName}
|
||||
@@ -546,12 +546,12 @@ function StepPassport({ form, errors, set, t, mode }: StepContentProps & { mode:
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -675,11 +675,11 @@ function StepContact({ form, errors, set, t }: StepContentProps) {
|
||||
error={errors.phoneAdditional}
|
||||
/>
|
||||
<FormInput
|
||||
type="phone"
|
||||
type="digits"
|
||||
label={t("Home phone") || "Öý telefony"}
|
||||
value={form.phoneHome}
|
||||
onChange={(v) => set("phoneHome", v)}
|
||||
placeholder={t("loanOrderForm.placeholders.phone") || "61 097 651"}
|
||||
placeholder={t("Home phone") || "Öý telefony"}
|
||||
error={errors.phoneHome}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -842,12 +842,12 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.guarantorPassportId}
|
||||
onChange={(v) => set("guarantorPassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantorPassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -856,16 +856,16 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.guarantorCardNumber}
|
||||
onChange={(v) => set("guarantorCardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantorCardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.guarantorCardName}
|
||||
@@ -951,11 +951,11 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
value={form.guarantor2PassportId}
|
||||
onChange={(v) => set("guarantor2PassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantor2PassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -964,15 +964,15 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
value={form.guarantor2CardNumber}
|
||||
onChange={(v) => set("guarantor2CardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantor2CardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
value={form.guarantor2CardName}
|
||||
onChange={(v) => set("guarantor2CardName", v)}
|
||||
@@ -1198,7 +1198,8 @@ export function LoanOrderMobileForm({ initialData, mode }: LoanOrderMobileFormPr
|
||||
onPrev={currentStep > 0 ? handleBack : undefined}
|
||||
onNext={!isLastStep ? handleNext : undefined}
|
||||
showSubmit={isLastStep}
|
||||
onSubmit={isLastStep ? doSubmit : undefined}
|
||||
saveOnEveryStep={mode === "edit"}
|
||||
onSubmit={doSubmit}
|
||||
submitLabel={mode === "create" ? t("loanOrders.create") || "Karz sargyt döredüň" : t("common.save") || "Ýatda sakla"}
|
||||
loadingLabel={t("common.loading") || "Ýüklenilýär..."}
|
||||
cancelLabel={t("common.cancel") || "Ýatyr"}
|
||||
@@ -1236,7 +1237,7 @@ function mapInitial(order: LoanOrderMobile): Partial<LoanOrderMobileFormData> {
|
||||
email: order.email ?? "",
|
||||
phone: formatFromApiPhone(order.phone),
|
||||
phoneAdditional: formatFromApiPhone(order.phoneAdditional),
|
||||
phoneHome: formatFromApiPhone(order.phoneHome),
|
||||
phoneHome: (order.phoneHome ?? order.homePhone ?? "").replace(/\D/g, ""),
|
||||
workCompany: order.workCompany ?? "",
|
||||
workCompanyAccountantNumber: formatFromApiPhone(order.workCompanyAccountantNumber),
|
||||
workRegion: order.workRegion ?? "AG",
|
||||
|
||||
@@ -279,14 +279,14 @@ function StepLoan({ form, errors, set, t, initialData }: StepContentProps & { in
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.loanCardInfo") || "Karz karty maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Loan card number") || "Karz kart belgisi"}
|
||||
value={form.loanCardNumber}
|
||||
onChange={(v) => set("loanCardNumber", v)}
|
||||
placeholder={t("Loan card number") || "Karz kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Loan card name") || "Karz kartdaky ady"}
|
||||
value={form.loanCardName}
|
||||
onChange={(v) => set("loanCardName", v)}
|
||||
@@ -538,16 +538,16 @@ function StepCard({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.cardNumber}
|
||||
onChange={(v) => set("cardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.cardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.cardName}
|
||||
@@ -601,12 +601,12 @@ function StepPassport({ form, errors, set, t, mode }: StepContentProps & { mode:
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -721,11 +721,11 @@ function StepContact({ form, errors, set, t }: StepContentProps) {
|
||||
error={errors.phoneAdditional}
|
||||
/>
|
||||
<FormInput
|
||||
type="phone"
|
||||
type="digits"
|
||||
label={t("Home phone") || "Öý telefony"}
|
||||
value={form.phoneHome}
|
||||
onChange={(v) => set("phoneHome", v)}
|
||||
placeholder={t("loanOrderForm.placeholders.phone") || "61 097 651"}
|
||||
placeholder={t("Home phone") || "Öý telefony"}
|
||||
error={errors.phoneHome}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -890,12 +890,12 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
required
|
||||
value={form.guarantorPassportId}
|
||||
onChange={(v) => set("guarantorPassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantorPassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -904,16 +904,16 @@ function StepGuarantor({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
required
|
||||
value={form.guarantorCardNumber}
|
||||
onChange={(v) => set("guarantorCardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantorCardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
required
|
||||
value={form.guarantorCardName}
|
||||
@@ -1009,11 +1009,11 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
</BentoCard>
|
||||
<BentoCard>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("Passport id") || "Pasport belgisi"}
|
||||
value={form.guarantor2PassportId}
|
||||
onChange={(v) => set("guarantor2PassportId", v)}
|
||||
placeholder={t("Passport id") || "Pasport belgisi"}
|
||||
placeholder="999999"
|
||||
error={errors.guarantor2PassportId}
|
||||
/>
|
||||
</BentoCard>
|
||||
@@ -1022,15 +1022,15 @@ function StepGuarantor2({ form, errors, set, t }: StepContentProps) {
|
||||
<BentoGrid cols={2}>
|
||||
<BentoCard title={t("loanOrderForm.titles.cardInfo") || "Kart maglumatlary"}>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-number"
|
||||
label={t("Card number") || "Kart belgisi"}
|
||||
value={form.guarantor2CardNumber}
|
||||
onChange={(v) => set("guarantor2CardNumber", v)}
|
||||
placeholder={t("Card number") || "Kart belgisi"}
|
||||
placeholder="9999 9999 9999 9999"
|
||||
error={errors.guarantor2CardNumber}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="card-name"
|
||||
label={t("Name on card") || "Kartdaky ady"}
|
||||
value={form.guarantor2CardName}
|
||||
onChange={(v) => set("guarantor2CardName", v)}
|
||||
@@ -1270,7 +1270,8 @@ export function LoanOrderForm({ mode, initialData }: LoanOrderFormProps) {
|
||||
onPrev={currentStep > 0 ? handleBack : undefined}
|
||||
onNext={!isLastStep ? handleNext : undefined}
|
||||
showSubmit={isLastStep}
|
||||
onSubmit={isLastStep ? doSubmit : undefined}
|
||||
saveOnEveryStep={mode === "edit"}
|
||||
onSubmit={doSubmit}
|
||||
submitLabel={mode === "create" ? t("loanOrders.create") || "Karz sargyt döredüň" : t("common.save") || "Ýatda sakla"}
|
||||
loadingLabel={t("common.loading") || "Ýüklenilýär..."}
|
||||
cancelLabel={t("common.cancel") || "Ýatyr"}
|
||||
@@ -1325,7 +1326,7 @@ function mapInitial(order: LoanOrder): Partial<LoanOrderFormData> {
|
||||
passportFour: order.passportFour ?? order.passportPage32Url ?? "",
|
||||
phone: formatFromApiPhone(order.phone),
|
||||
phoneAdditional: formatFromApiPhone(order.phoneAdditional),
|
||||
phoneHome: formatFromApiPhone(order.phoneHome ?? order.homePhone),
|
||||
phoneHome: (order.phoneHome ?? order.homePhone ?? "").replace(/\D/g, ""),
|
||||
email: order.email ?? "",
|
||||
workCompany: order.workCompany ?? "",
|
||||
workCompanyAccountantNumber: formatFromApiPhone(order.workCompanyAccountantNumber ?? order.workHrPhone),
|
||||
|
||||
@@ -68,11 +68,8 @@ export const loanOrderFormSchema = z.object({
|
||||
.optional(),
|
||||
phoneHome: z
|
||||
.string()
|
||||
.refine((val) => !val || val.replace(/\D/g, "").length === 0 || val.replace(/\D/g, "").length === 8, {
|
||||
message: "validation.invalidPhone",
|
||||
})
|
||||
.refine((val) => !val || val.replace(/\D/g, "").length === 0 || VALID_PHONE_PREFIXES.includes(val.replace(/\D/g, "").slice(0, 2)), {
|
||||
message: "validation.invalidPhonePrefix",
|
||||
.refine((val) => !val || /^\d+$/.test(val.replace(/\s/g, "")), {
|
||||
message: "validation.invalidNumber",
|
||||
})
|
||||
.optional(),
|
||||
email: z.string().optional(),
|
||||
|
||||
@@ -182,11 +182,11 @@ function StepPassport({ form, errors, set, t }: StepContentProps) {
|
||||
required
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("loanPaidOffLetters.fields.passportId", "Pasport belgisi")}
|
||||
value={form.passportId}
|
||||
onChange={set("passportId")}
|
||||
placeholder="101010"
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
required
|
||||
/>
|
||||
@@ -427,7 +427,21 @@ export function LoanPaidOffLetterForm({ mode, initialData }: LoanPaidOffLetterFo
|
||||
});
|
||||
|
||||
const form = watch();
|
||||
const errors = useMemo(() => flattenErrors(rhfErrors as Record<string, { message?: string } | undefined>), [rhfErrors]);
|
||||
|
||||
// Live-recomputed validation errors for submitted steps, so required-field
|
||||
// warnings stay visible under fields (mirrors loanOrderForm behavior).
|
||||
const allSubmittedErrors = useMemo(() => {
|
||||
const result: FlatErrors = {};
|
||||
for (const stepIdx of submittedSteps) {
|
||||
Object.assign(result, STEPS[stepIdx].validate(form));
|
||||
}
|
||||
return result;
|
||||
}, [form, submittedSteps]);
|
||||
|
||||
const errors = useMemo(() => {
|
||||
const fromRHF = flattenErrors(rhfErrors as Record<string, { message?: string } | undefined>);
|
||||
return { ...fromRHF, ...allSubmittedErrors };
|
||||
}, [rhfErrors, allSubmittedErrors]);
|
||||
|
||||
const set = useCallback(
|
||||
<K extends keyof LoanPaidOffLetterFormData>(key: K) =>
|
||||
@@ -586,7 +600,8 @@ export function LoanPaidOffLetterForm({ mode, initialData }: LoanPaidOffLetterFo
|
||||
onPrev={currentStep > 0 ? handleBack : undefined}
|
||||
onNext={!isLastStep ? handleNext : undefined}
|
||||
showSubmit={isLastStep}
|
||||
onSubmit={isLastStep ? doSubmit : undefined}
|
||||
saveOnEveryStep={mode === "edit"}
|
||||
onSubmit={doSubmit}
|
||||
submitLabel={mode === "create" ? t("common.create", "Döret") : t("common.save", "Ýatda sakla")}
|
||||
loadingLabel={t("common.loading", "Ýüklenilýär...")}
|
||||
cancelLabel={t("common.cancel", "Ýatyr")}
|
||||
|
||||
@@ -8,9 +8,13 @@ import { FormInput } from "@/components/formInput";
|
||||
import { InfiniteSelect, type InfiniteSelectOption, type InfiniteSelectProps } from "@/components/infiniteSelect";
|
||||
import { Checkbox } from "@/components/ui/checkbox";
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { KeyRound } from "lucide-react";
|
||||
import { FormActions } from "@/components/formActions";
|
||||
import { AvatarUpload } from "@/components/avatarUpload";
|
||||
import { BentoGrid, BentoCard } from "@/components/bento";
|
||||
import { AssignDialog, type AssignDialogKind } from "@/features/shared/components/assignDialog";
|
||||
import { useCreateOperator, useUpdateOperator, operatorKeys } from "../hooks/useOperators";
|
||||
import { useInfiniteRoles } from "@/features/roles/hooks/useRoles";
|
||||
import { useInfiniteBranches } from "@/features/shared/hooks/useSharedBranchUsers";
|
||||
@@ -62,6 +66,9 @@ export function OperatorForm({ mode, initialData }: OperatorFormProps) {
|
||||
|
||||
const isPending = createOperator.isPending || updateOperator.isPending;
|
||||
|
||||
const [assignDialog, setAssignDialog] = useState<AssignDialogKind | null>(null);
|
||||
const operatorPermissions = (initialData as OperatorDetail | undefined)?.permissions ?? [];
|
||||
|
||||
const schema = useMemo(() => operatorFormSchema(mode, t), [mode, t, i18n.language]);
|
||||
|
||||
// ── Role infinite-scroll select ──
|
||||
@@ -210,9 +217,17 @@ export function OperatorForm({ mode, initialData }: OperatorFormProps) {
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-5">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{mode === "create" ? t("operators.createTitle", "Operator dörediň") : t("operators.editTitle", "Operator üýtgetmek")}
|
||||
</h1>
|
||||
<div className="flex items-center justify-between">
|
||||
<h1 className="text-xl font-semibold text-foreground">
|
||||
{mode === "create" ? t("operators.createTitle", "Operator dörediň") : t("operators.editTitle", "Operator üýtgetmek")}
|
||||
</h1>
|
||||
{mode === "edit" && (
|
||||
<Button type="button" variant="outline" size="sm" className="gap-1.5" onClick={() => setAssignDialog("permission")}>
|
||||
<KeyRound size={14} />
|
||||
{t("profile.actions.assignPermission", "Rugsat birikdiriň")}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<BentoGrid cols={2}>
|
||||
{/* ── Identity ── */}
|
||||
<BentoCard title={t("users.sections.identity", "Şahsy maglumat")}>
|
||||
@@ -358,6 +373,29 @@ export function OperatorForm({ mode, initialData }: OperatorFormProps) {
|
||||
/>
|
||||
</div>
|
||||
</BentoCard>
|
||||
|
||||
{/* ── Permissions (Edit mode only) ── */}
|
||||
{mode === "edit" && (
|
||||
<BentoCard title={t("users.sections.permissions", "Rugsatlar")} span="full">
|
||||
<div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3 p-2">
|
||||
<div className="flex flex-wrap gap-1.5 items-center">
|
||||
{operatorPermissions.length > 0 ? (
|
||||
operatorPermissions.map((p) => (
|
||||
<Badge key={p.id} variant="secondary">
|
||||
{p.name}
|
||||
</Badge>
|
||||
))
|
||||
) : (
|
||||
<span className="text-sm text-muted-foreground">{t("common.noData", "Rugsat ýok")}</span>
|
||||
)}
|
||||
</div>
|
||||
<Button type="button" variant="outline" size="sm" className="gap-1.5 shrink-0" onClick={() => setAssignDialog("permission")}>
|
||||
<KeyRound size={14} />
|
||||
{t("profile.actions.assignPermission", "Rugsat birikdiriň")}
|
||||
</Button>
|
||||
</div>
|
||||
</BentoCard>
|
||||
)}
|
||||
</BentoGrid>
|
||||
|
||||
<FormActions
|
||||
@@ -366,6 +404,21 @@ export function OperatorForm({ mode, initialData }: OperatorFormProps) {
|
||||
onCancel={() => navigate(-1)}
|
||||
submitLabel={mode === "create" ? t("users.actions.create", "Ulanyjy dörediň") : t("users.actions.save", "Ýatda sakla")}
|
||||
/>
|
||||
|
||||
{/* ── Assign dialog (edit mode only) ── */}
|
||||
{mode === "edit" && assignDialog && initialData?.id && (
|
||||
<AssignDialog
|
||||
kind={assignDialog}
|
||||
targetUserId={initialData.id}
|
||||
targetUserName={
|
||||
[initialData.firstName, initialData.lastName].filter(Boolean).join(" ") || initialData.name || initialData.username
|
||||
}
|
||||
onAssigned={() => {
|
||||
queryClient.invalidateQueries({ queryKey: operatorKeys.detail(initialData.id) });
|
||||
}}
|
||||
onClose={() => setAssignDialog(null)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -335,12 +335,12 @@ function StepPassport({ form, errors, set, t, mode }: StepContentProps) {
|
||||
error={errors.passportSerie}
|
||||
/>
|
||||
<FormInput
|
||||
type="text"
|
||||
type="passport-id"
|
||||
label={t("cardOrder.field.passportId", "Pasport belgisi")}
|
||||
required
|
||||
value={form.passportId}
|
||||
onChange={(v) => set("passportId", v)}
|
||||
placeholder={t("cardOrder.field.passportId", "Pasport belgisi")}
|
||||
placeholder="999999"
|
||||
error={errors.passportId}
|
||||
/>
|
||||
<FormInput
|
||||
|
||||
@@ -18,7 +18,11 @@ export interface AddPermissionRolePayload {
|
||||
roleId: number;
|
||||
}
|
||||
|
||||
export type AddPermissionUserPayload = AddPermissionRolePayload;
|
||||
export interface AddPermissionUserPayload {
|
||||
permissionId: number;
|
||||
userId: number;
|
||||
effect?: string;
|
||||
}
|
||||
|
||||
// Re-export so shared hooks can import from one place
|
||||
export type { BranchListParams, BranchListResponse };
|
||||
@@ -76,7 +80,17 @@ export async function postPermissionRole(payload: AddPermissionRolePayload): Pro
|
||||
await apiClient.post("/permission-roles", payload);
|
||||
}
|
||||
|
||||
export const postPermissionUser = postPermissionRole;
|
||||
/**
|
||||
* POST /permission-users
|
||||
* Assigns a permission to a user.
|
||||
*/
|
||||
export async function postPermissionUser(payload: AddPermissionUserPayload): Promise<void> {
|
||||
await apiClient.post("/permission-users", {
|
||||
permissionId: payload.permissionId,
|
||||
userId: payload.userId,
|
||||
effect: payload.effect ?? "allow",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Proxy for branch list fetching — kept here so shared hooks
|
||||
|
||||
214
src/features/shared/components/assignDialog.tsx
Normal file
214
src/features/shared/components/assignDialog.tsx
Normal file
@@ -0,0 +1,214 @@
|
||||
import { useState, useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import * as VisuallyHidden from "@radix-ui/react-visually-hidden";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogFooter,
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from "@/components/ui/alert-dialog";
|
||||
import { InfiniteSelect, type InfiniteSelectOption } from "@/components/infiniteSelect";
|
||||
import { useInfiniteUsers } from "@/features/allUsers/hooks/useAllUsers";
|
||||
import { useInfiniteRoles } from "@/features/roles/hooks/useRoles";
|
||||
import { useInfinitePermissions } from "@/features/permissions/hooks/usePermissions";
|
||||
import { useInfiniteBranches } from "@/features/shared/hooks/useSharedBranchUsers";
|
||||
import { useAssignRoleToUser, useAssignPermissionToUser, useAssignBranchToUser } from "@/features/shared/hooks/useSharedUserAssignments";
|
||||
import type { LocalizedText } from "@/features/branches/api/branchesApi";
|
||||
|
||||
export type AssignDialogKind = "role" | "permission" | "branch";
|
||||
|
||||
export interface AssignDialogProps {
|
||||
kind: AssignDialogKind;
|
||||
onClose: () => void;
|
||||
targetUserId?: number;
|
||||
targetUserName?: string;
|
||||
onAssigned?: () => void;
|
||||
}
|
||||
|
||||
const ASSIGN_DIALOG_TITLES: Record<AssignDialogKind, string> = {
|
||||
role: "profile.actions.assignRole",
|
||||
permission: "profile.actions.assignPermission",
|
||||
branch: "profile.actions.assignBranch",
|
||||
};
|
||||
|
||||
const ASSIGN_DIALOG_FIELD_LABELS: Record<AssignDialogKind, string> = {
|
||||
role: "users.fields.role",
|
||||
permission: "users.sections.permissions",
|
||||
branch: "users.sections.branches",
|
||||
};
|
||||
|
||||
/**
|
||||
* Dialog for assigning a role, permission, or branch to a user (staff).
|
||||
* Permissions are assigned directly to users via POST /permission-users.
|
||||
*/
|
||||
export function AssignDialog({ kind, onClose, targetUserId, targetUserName, onAssigned }: AssignDialogProps) {
|
||||
const { t, i18n } = useTranslation();
|
||||
const lang = (i18n.language === "ru" ? "ru" : i18n.language === "en" ? "en" : "tm") as keyof LocalizedText;
|
||||
|
||||
const [targetSearch, setTargetSearch] = useState("");
|
||||
const [targetValue, setTargetValue] = useState<string>(() => (targetUserId ? String(targetUserId) : ""));
|
||||
const [resourceSearch, setResourceSearch] = useState("");
|
||||
const [resourceValue, setResourceValue] = useState("");
|
||||
const [error, setError] = useState<string | undefined>();
|
||||
|
||||
// Target query: admin users list (GET /users)
|
||||
const staffQuery = useInfiniteUsers(targetSearch);
|
||||
|
||||
// Resource queries
|
||||
const rolesQuery = useInfiniteRoles(resourceSearch, kind === "role");
|
||||
const permissionsQuery = useInfinitePermissions(resourceSearch, kind === "permission");
|
||||
const branchesQuery = useInfiniteBranches(resourceSearch, kind === "branch");
|
||||
|
||||
const roleMutation = useAssignRoleToUser();
|
||||
const permissionMutation = useAssignPermissionToUser();
|
||||
const branchMutation = useAssignBranchToUser();
|
||||
const isPending = roleMutation.isPending || permissionMutation.isPending || branchMutation.isPending;
|
||||
|
||||
const targetOptions: InfiniteSelectOption[] = useMemo(() => {
|
||||
const opts: InfiniteSelectOption[] = (staffQuery.data?.pages ?? [])
|
||||
.flatMap((p) => p?.users ?? [])
|
||||
.map((u) => ({
|
||||
value: String(u.id),
|
||||
label: [u.firstName, u.lastName].filter(Boolean).join(" ") || u.name || u.username || String(u.id),
|
||||
}));
|
||||
|
||||
if (targetUserId) {
|
||||
const valStr = String(targetUserId);
|
||||
if (!opts.some((o) => o.value === valStr)) {
|
||||
opts.unshift({ value: valStr, label: targetUserName || valStr });
|
||||
}
|
||||
}
|
||||
return opts;
|
||||
}, [staffQuery.data, targetUserId, targetUserName]);
|
||||
|
||||
const targetLabel = t("profile.assign.userLabel", "Ulanyjy");
|
||||
const targetLoading = staffQuery.isLoading;
|
||||
const targetLoadingMore = staffQuery.isFetchingNextPage;
|
||||
const targetHasNextPage = !!staffQuery.hasNextPage;
|
||||
const loadMoreTargets = () => staffQuery.fetchNextPage();
|
||||
|
||||
const resourceOptions: InfiniteSelectOption[] = useMemo(() => {
|
||||
if (kind === "role") {
|
||||
return (rolesQuery.data?.pages ?? [])
|
||||
.flatMap((p) => p?.roles ?? [])
|
||||
.map((r) => ({ value: String(r.id), label: r.name || r.code || String(r.id) }));
|
||||
}
|
||||
if (kind === "permission") {
|
||||
return (permissionsQuery.data?.pages ?? [])
|
||||
.flatMap((p) => p?.permissions ?? [])
|
||||
.map((perm) => ({ value: String(perm.id), label: perm.name || perm.code || String(perm.id) }));
|
||||
}
|
||||
return (branchesQuery.data?.pages ?? [])
|
||||
.flatMap((p) => p?.branches ?? [])
|
||||
.map((b) => ({
|
||||
value: String(b.id),
|
||||
label: b.name?.[lang] || b.name?.tm || b.name?.en || b.name?.ru || b.uniqueCode || String(b.id),
|
||||
}));
|
||||
}, [kind, rolesQuery.data, permissionsQuery.data, branchesQuery.data, lang]);
|
||||
|
||||
const resourceLoading =
|
||||
kind === "role" ? rolesQuery.isLoading : kind === "permission" ? permissionsQuery.isLoading : branchesQuery.isLoading;
|
||||
const resourceLoadingMore =
|
||||
kind === "role"
|
||||
? rolesQuery.isFetchingNextPage
|
||||
: kind === "permission"
|
||||
? permissionsQuery.isFetchingNextPage
|
||||
: branchesQuery.isFetchingNextPage;
|
||||
const resourceHasNextPage =
|
||||
kind === "role" ? !!rolesQuery.hasNextPage : kind === "permission" ? !!permissionsQuery.hasNextPage : !!branchesQuery.hasNextPage;
|
||||
const loadMoreResources = () => {
|
||||
if (kind === "role") rolesQuery.fetchNextPage();
|
||||
else if (kind === "permission") permissionsQuery.fetchNextPage();
|
||||
else branchesQuery.fetchNextPage();
|
||||
};
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!targetValue || !resourceValue) {
|
||||
setError(t("common.errors.required", "Meýdança hökmany doldurylmaly"));
|
||||
return;
|
||||
}
|
||||
setError(undefined);
|
||||
|
||||
const userId = Number(targetValue);
|
||||
const secondId = Number(resourceValue);
|
||||
const onSuccess = () => {
|
||||
setResourceValue("");
|
||||
onAssigned?.();
|
||||
onClose();
|
||||
};
|
||||
|
||||
if (kind === "role") {
|
||||
roleMutation.mutate({ userId, roleId: secondId }, { onSuccess });
|
||||
} else if (kind === "permission") {
|
||||
permissionMutation.mutate({ userId, permissionId: secondId, effect: "allow" }, { onSuccess });
|
||||
} else {
|
||||
branchMutation.mutate({ userId, branchId: secondId }, { onSuccess });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<AlertDialog open onOpenChange={(open) => !open && onClose()}>
|
||||
<AlertDialogContent className="max-w-md sm:max-w-md">
|
||||
<AlertDialogHeader>
|
||||
<AlertDialogTitle>{t(ASSIGN_DIALOG_TITLES[kind])}</AlertDialogTitle>
|
||||
<VisuallyHidden.Root>
|
||||
<AlertDialogDescription>{t(ASSIGN_DIALOG_TITLES[kind])}</AlertDialogDescription>
|
||||
</VisuallyHidden.Root>
|
||||
</AlertDialogHeader>
|
||||
|
||||
<div className="space-y-3">
|
||||
<InfiniteSelect
|
||||
required
|
||||
label={targetLabel}
|
||||
value={targetValue}
|
||||
onChange={(v) => {
|
||||
setTargetValue(v);
|
||||
if (error) setError(undefined);
|
||||
}}
|
||||
disabled={!!targetUserId || isPending}
|
||||
options={targetOptions}
|
||||
placeholder={t("loanOrderForm.placeholders.searchableSelect") || "Saýlamak üçin basyň"}
|
||||
loading={targetLoading}
|
||||
isLoadingMore={targetLoadingMore}
|
||||
hasNextPage={targetHasNextPage}
|
||||
onLoadMore={loadMoreTargets}
|
||||
searchValue={targetSearch}
|
||||
onSearchChange={setTargetSearch}
|
||||
/>
|
||||
|
||||
<InfiniteSelect
|
||||
required
|
||||
label={t(ASSIGN_DIALOG_FIELD_LABELS[kind])}
|
||||
value={resourceValue}
|
||||
onChange={(v) => {
|
||||
setResourceValue(v);
|
||||
if (error) setError(undefined);
|
||||
}}
|
||||
error={error}
|
||||
disabled={isPending}
|
||||
options={resourceOptions}
|
||||
placeholder={t("loanOrderForm.placeholders.searchableSelect") || "Saýlamak üçin basyň"}
|
||||
loading={resourceLoading}
|
||||
isLoadingMore={resourceLoadingMore}
|
||||
hasNextPage={resourceHasNextPage}
|
||||
onLoadMore={loadMoreResources}
|
||||
searchValue={resourceSearch}
|
||||
onSearchChange={setResourceSearch}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<AlertDialogFooter>
|
||||
<Button variant="ghost" size="sm" onClick={onClose} disabled={isPending}>
|
||||
{t("common.cancel", "Yza")}
|
||||
</Button>
|
||||
<Button size="sm" onClick={handleSubmit} disabled={!targetValue || !resourceValue || isPending}>
|
||||
{t("common.save", "Ýatda sakla")}
|
||||
</Button>
|
||||
</AlertDialogFooter>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
);
|
||||
}
|
||||
@@ -5,9 +5,11 @@ import {
|
||||
postBranchUser,
|
||||
postRoleUser,
|
||||
postPermissionRole,
|
||||
postPermissionUser,
|
||||
type AddBranchUserPayload,
|
||||
type AddRoleUserPayload,
|
||||
type AddPermissionRolePayload,
|
||||
type AddPermissionUserPayload,
|
||||
} from "../api/sharedApi";
|
||||
|
||||
// ─── Query Keys ───────────────────────────────────────────────────────────────
|
||||
@@ -21,7 +23,11 @@ export const userProfileKeys = {
|
||||
*/
|
||||
function useInvalidateProfile() {
|
||||
const queryClient = useQueryClient();
|
||||
return () => queryClient.invalidateQueries({ queryKey: userProfileKeys.profile });
|
||||
return () => {
|
||||
queryClient.invalidateQueries({ queryKey: userProfileKeys.profile });
|
||||
queryClient.invalidateQueries({ queryKey: ["operators"] });
|
||||
queryClient.invalidateQueries({ queryKey: ["users"] });
|
||||
};
|
||||
}
|
||||
|
||||
// ─── useAssignRoleToUser ──────────────────────────────────────────────────────
|
||||
@@ -61,7 +67,23 @@ export function useAssignPermissionToRole() {
|
||||
});
|
||||
}
|
||||
|
||||
export const useAssignPermissionToUser = useAssignPermissionToRole;
|
||||
// ─── useAssignPermissionToUser ────────────────────────────────────────────────
|
||||
|
||||
/**
|
||||
* POST /permission-users — assigns a permission to the given staff user and refreshes the caches.
|
||||
*/
|
||||
export function useAssignPermissionToUser() {
|
||||
const { t } = useTranslation();
|
||||
const invalidateProfile = useInvalidateProfile();
|
||||
|
||||
return useMutation({
|
||||
mutationFn: (payload: AddPermissionUserPayload) => postPermissionUser(payload),
|
||||
onSuccess: () => {
|
||||
invalidateProfile();
|
||||
toast.success(t("profile.assign.success", "Üstünlikli birikdirildi"));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// ─── useAssignBranchToUser ────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user