fixed some missed data, added role based function(user)
This commit is contained in:
1 parent
5884ec831c
commit
9ad86634dd
31 files changed
+1276
-977
No files matched your search
@@ -10,6 +10,7 @@ import { useCreateCardBalance, useUpdateCardBalance } from "@/features/cardBalan
|
||||
import { cardBalanceFormSchema, DEFAULT_FORM_VALUES, mapInitial, buildPayload } from "@/features/cardBalance/schemas/cardBalance.schema";
|
||||
import type { CardBalanceFormData } from "@/features/cardBalance/schemas/cardBalance.schema";
|
||||
import { useInfiniteUsers } from "@/features/allUsers/hooks/useAllUsers";
|
||||
import { MONTH_OPTIONS, CARD_YEAR_OPTIONS } from "@/constants";
|
||||
|
||||
interface CardBalanceFormProps {
|
||||
mode: "create" | "edit";
|
||||
@@ -42,16 +43,6 @@ const CURRENCY_OPTIONS: SelectOption[] = [
|
||||
{ value: "EUR", label: "EUR" },
|
||||
];
|
||||
|
||||
const MONTH_OPTIONS: SelectOption[] = Array.from({ length: 12 }, (_, i) => {
|
||||
const val = String(i + 1).padStart(2, "0");
|
||||
return { value: val, label: val };
|
||||
});
|
||||
|
||||
const YEAR_OPTIONS: SelectOption[] = Array.from({ length: 20 }, (_, i) => {
|
||||
const year = String(new Date().getFullYear() + i);
|
||||
return { value: year, label: year };
|
||||
});
|
||||
|
||||
// ─── Component ────────────────────────────────────────────────────────────────
|
||||
|
||||
export function CardBalanceForm({ mode, initialData }: CardBalanceFormProps) {
|
||||
@@ -182,7 +173,7 @@ export function CardBalanceForm({ mode, initialData }: CardBalanceFormProps) {
|
||||
label={t("Card expiry year", "Kart Möhleti (ýyl)")}
|
||||
value={form.expiryYear}
|
||||
onChange={setString("expiryYear")}
|
||||
options={YEAR_OPTIONS}
|
||||
options={CARD_YEAR_OPTIONS}
|
||||
placeholder={t("Select", "Saýlamak üçin basyň")}
|
||||
error={errMsg(errors.expiryYear)}
|
||||
required
|
||||
|
||||
Reference in new issue
Block a user