added lang param to api
This commit is contained in:
1 parent
11903e23bf
commit
524733ad9f
50 files changed
+798
-361
No files matched your search
@@ -16,8 +16,11 @@ import { useCreateCardPin, useUpdateCardPin } from "@/features/cardPins/hooks/us
|
||||
import { validateStep, DEFAULT_FORM_VALUES, buildPayload } from "@/features/cardPins/schemas/cardPin.schema";
|
||||
import type { CardPinFormData } from "@/features/cardPins/schemas/cardPin.schema";
|
||||
import { useCardTypes } from "@/features/cardTypes/hooks/useCardTypes";
|
||||
import { resolveCardTypeTitle } from "@/features/cardTypes/api/cardTypesApi";
|
||||
import { useBranches } from "@/features/branches/hooks/useBranches";
|
||||
import { resolveLocalizedName } from "@/features/branches/api/branchesApi";
|
||||
import { useDistricts } from "@/features/districts/hooks/useDistricts";
|
||||
import { resolveDistrictName } from "@/features/districts/api/districtsApi";
|
||||
import { PASSPORT_SERIES_OPTIONS, getStatusOptions } from "@/constants";
|
||||
import { DocumentUpload } from "@/components/documentUpload";
|
||||
import { InfiniteSelect, type InfiniteSelectOption } from "@/components/infiniteSelect";
|
||||
@@ -396,7 +399,7 @@ export function CardPinForm({ mode, initialData }: CardPinFormProps) {
|
||||
() =>
|
||||
(cardTypesData?.paymentCards ?? []).map((ct) => ({
|
||||
value: String(ct.id),
|
||||
label: ct.title[lang] || ct.title.tm,
|
||||
label: resolveCardTypeTitle(ct.title, lang),
|
||||
})),
|
||||
[cardTypesData, lang],
|
||||
);
|
||||
@@ -405,7 +408,7 @@ export function CardPinForm({ mode, initialData }: CardPinFormProps) {
|
||||
() =>
|
||||
(branchesData?.branches ?? []).map((b) => ({
|
||||
value: String(b.id),
|
||||
label: b.name[lang] || b.name.tm,
|
||||
label: resolveLocalizedName(b.name, lang),
|
||||
})),
|
||||
[branchesData, lang],
|
||||
);
|
||||
@@ -413,8 +416,8 @@ export function CardPinForm({ mode, initialData }: CardPinFormProps) {
|
||||
const districtOptions = useMemo(
|
||||
() =>
|
||||
(districtsData?.provinces ?? []).map((d) => ({
|
||||
value: d.region?.tm || d.name.tm,
|
||||
label: d.name[lang] || d.name.tm,
|
||||
value: resolveDistrictName(d.region, "tm") || resolveDistrictName(d.name, "tm"),
|
||||
label: resolveDistrictName(d.name, lang),
|
||||
})),
|
||||
[districtsData, lang],
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user