news api integrated

This commit is contained in:
Kakabay 2024-04-08 17:31:53 +05:00
parent 4d0cf293b6
commit 097c6b5efa
2 changed files with 12 additions and 5 deletions

View File

@ -54,11 +54,14 @@ const AcceptStage = ({
const loanCreateCheck = async () => {
try {
const response = fetch(
const response = await fetch(
'https://shahsyotag.halkbank.gov.tm/onlineloancre-services/api/loancre/check',
{
method: 'POST',
headers: { 'Content-Type': 'aplication/json' },
headers: {
Accept: 'application/json, text/plain',
'Content-Type': 'application/json;charset=UTF-8',
},
body: JSON.stringify({
clientRecipient: {
idSeria: borrowerData.idSeria,
@ -96,6 +99,8 @@ const AcceptStage = ({
const jsonedResponse = await response.json();
console.log(jsonedResponse);
if (jsonedResponse.errCode === 0) {
sendCode();
} else {
@ -253,7 +258,6 @@ const AcceptStage = ({
disabled={cardDetails.length !== 23 && !isLoading ? true : false}
onClick={() => {
onSubmit();
setStage(9);
}}>
<div>
<h3>

View File

@ -119,11 +119,14 @@ const PhoneAccept = ({
const loanCreateCheck = async () => {
try {
const response = fetch(
const response = await fetch(
'https://shahsyotag.halkbank.gov.tm/onlineloancre-services/api/loancre/check',
{
method: 'POST',
headers: { 'Content-Type': 'aplication/json' },
headers: {
Accept: 'application/json, text/plain',
'Content-Type': 'application/json;charset=UTF-8',
},
body: JSON.stringify({
clientRecipient: {
idSeria: borrowerData.idSeria,