Merge branch 'payment' into 'staging'
Payment See merge request frontend/marketplace!132
This commit is contained in:
commit
acb08e7918
@ -65,14 +65,21 @@ export async function getCustomTariffs(
|
||||
signal: AbortSignal | undefined
|
||||
): Promise<[ServiceKeyToPrivilegesMap | null, string?]> {
|
||||
try {
|
||||
const getCustomTariffsResponse = await makeRequest<null, ServiceKeyToPrivilegesMap>({
|
||||
const customTariffsResponse = await makeRequest<null, ServiceKeyToPrivilegesMap>({
|
||||
url: apiUrl + "/privilege/service",
|
||||
signal,
|
||||
method: "get",
|
||||
useToken: true,
|
||||
})
|
||||
|
||||
return [getCustomTariffsResponse]
|
||||
const tempCustomTariffsResponse = {
|
||||
...customTariffsResponse,
|
||||
squiz: customTariffsResponse.squiz.filter(
|
||||
({ name }) => !name.toLocaleLowerCase().includes("шильдик")
|
||||
),
|
||||
};
|
||||
|
||||
return [tempCustomTariffsResponse]
|
||||
} catch (nativeError) {
|
||||
const [error] = parseAxiosError(nativeError)
|
||||
|
||||
|
@ -53,7 +53,7 @@ export default function Payment() {
|
||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||
|
||||
const [selectedPaymentMethod, setSelectedPaymentMethod] =
|
||||
useState<PaymentMethodType | null>(null);
|
||||
useState<PaymentMethodType | null>("rspay");
|
||||
const [warnModalOpen, setWarnModalOpen] = useState<boolean>(false);
|
||||
const [sorryModalOpen, setSorryModalOpen] = useState<boolean>(false);
|
||||
const [paymentValueField, setPaymentValueField] = useState<string>("0");
|
||||
@ -85,6 +85,10 @@ export default function Payment() {
|
||||
}, [selectedPaymentMethod]);
|
||||
|
||||
async function handleChoosePaymentClick() {
|
||||
if (!selectedPaymentMethod) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Number(paymentValueField) === 0) {
|
||||
return;
|
||||
}
|
||||
@ -175,7 +179,7 @@ export default function Payment() {
|
||||
/>
|
||||
))}
|
||||
<PaymentMethodCard
|
||||
isSelected={false}
|
||||
isSelected={true}
|
||||
label={"Расчётный счёт"}
|
||||
image={rsPayLogo}
|
||||
onClick={async() => {
|
||||
|
Loading…
Reference in New Issue
Block a user