РС принимает строку

This commit is contained in:
Nastya 2024-02-23 01:36:06 +03:00
parent c5dc6166ae
commit 65ff25a122
2 changed files with 4 additions and 4 deletions

@ -49,7 +49,7 @@ export async function sendPayment({
}
}
export const sendRSPayment = async (money: number): Promise<string | null> => {
export const sendRSPayment = async (money: string): Promise<string | null> => {
try {
await makeRequest<unknown, string>({
url: apiUrl + "/wallet/rspay",

@ -196,7 +196,7 @@ export default function Payment() {
return;
}
const sendRSPaymentError = await sendRSPayment(Number(paymentValueField));
const sendRSPaymentError = await sendRSPayment(paymentValueField);
if (sendRSPaymentError) {
return enqueueSnackbar(sendRSPaymentError);
@ -254,7 +254,7 @@ export default function Payment() {
value: paymentValueField,
type: "number",
}}
onChange={(e) => setPaymentValueField(e.target.value)}
onChange={(e) => setPaymentValueField(e.target.value.replace(/^0+(?=\d\.)/, ''))}
id="payment-amount"
gap={upMd ? "16px" : "10px"}
color={"#F2F3F7"}
@ -279,7 +279,7 @@ export default function Payment() {
return;
}
const sendRSPaymentError = await sendRSPayment(Number(paymentValueField));
const sendRSPaymentError = await sendRSPayment(paymentValueField);
if (sendRSPaymentError) {
return enqueueSnackbar(sendRSPaymentError);