Merge branch 'payment' into 'staging'

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

See merge request frontend/marketplace!137
This commit is contained in:
Nastya 2024-02-22 22:36:45 +00:00
commit 833dd025aa
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 { try {
await makeRequest<unknown, string>({ await makeRequest<unknown, string>({
url: apiUrl + "/wallet/rspay", url: apiUrl + "/wallet/rspay",

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