diff --git a/lib/api.js b/lib/api.js index de5d9ba..f9d7624 100644 --- a/lib/api.js +++ b/lib/api.js @@ -19,4 +19,4 @@ export const AppFile = addr => { return `${serve}/${addr}` } -export const AppProduction = 'https://mipstockholder.iran.liara.run/api/' +export const AppProduction = 'https://mehriranianco.ir/api/' diff --git a/pages/stock-unit/stock-sales/index.jsx b/pages/stock-unit/stock-sales/index.jsx index 959d336..99b78cd 100644 --- a/pages/stock-unit/stock-sales/index.jsx +++ b/pages/stock-unit/stock-sales/index.jsx @@ -17,16 +17,19 @@ import moment from 'moment-jalaali' const StockSalesContainer = () => { const [userName, setUserName] = useState() - const [codeMeli, setCodeMeli] = useState() + const [national_code, setNational_code] = useState() const [mobileNumber, setMobileNumber] = useState() const [numberStock, setNumberStock] = useState('') const [stockType, setStockType] = useState(null) const [InvestmentType, setInvestmentType] = useState('1') + const [code, setCode] = useState('1') + const [InvestmentPrice, setInvestmentPrice] = useState('0') const [Loading, setLoading] = useState(false) const [showSuccessSubmitForm, setShowSuccessSubmitForm] = useState(false) + const [textareaValue, setTextareaValue] = useState(''); const { register, @@ -40,13 +43,15 @@ const StockSalesContainer = () => { toast.loading('در حال ثبت درخواست شما') axios .post(`${AppProduction}public/website/request`, { - userName: userName, - codeMeli: codeMeli, - numberStock: numberStock, - stockType: stockType, + name: userName, + national_code: national_code, + stock_count: numberStock, investment_price: InvestmentPrice, - investment_type: InvestmentType - + investment_type: InvestmentType, + type: "buy-stock", + stock_type: stockType, + description: textareaValue, + mobile_number: mobileNumber // name: name, // mobile_number: mobileNumber, }) @@ -55,7 +60,8 @@ const StockSalesContainer = () => { setShowSuccessSubmitForm(true) toast.remove() toast.success('درخواست شما ثبت شد به زودی کار شناسان ما به شما تماس می گیرند') - await console.log('res', res) + console.log('res', res.data.request) + setCode(res.data.request.rrn) }) .catch(async err => { setLoading(false) @@ -146,12 +152,12 @@ const StockSalesContainer = () => {