Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.7 kB
1
Indexable
Never
getecombooking(func,custcode) {
    console.log("---------- inside getecombooking ---------- ",custcode);
    
    fetch('https://lrpv2-demo.solverminds.net/EcomAPI/Booking/bookingSummary', {
    method: 'POST',
    headers: {
    
    'Content-Type': 'application/json',
    },
    
    
    body: JSON.stringify({
    
    // "usercode":"INSVM234",
    // "from_date":"2021-02-01",
    // "to_date":"2021-02-10"
    
    "usercode":custcode,
    "from_date":"",
    "to_date":""
    
    }
    
    ),
    }).then((response) => response.json())
    
    .then((responseJson) => {
    
    console.log(" getecombooking summary >>>>>>>>>", responseJson);
    
    
    const func1 = func;
    func1(responseJson);
    
    
    })
    .catch((error) => {
    alert('session expired ! try again ')
    console.error(error);
    
    });
    
    }
    
    
    getecom_booking1(func,bookno) {
    console.log("---------- inside getecombooking 1---------- ",bookno);
    
    fetch('https://lrpv2-demo.solverminds.net/EcomAPI/Booking/bookingView', {
    method: 'POST',
    headers: {
    
    'Content-Type': 'application/json',
    },
    
    
    body: JSON.stringify({
    
    
    "lrpBookNo":bookno,
    "lrpEcomStatus":"L",
    "appVersion":"",
    "bookNo":""
    
    
    }
    
    ),
    }).then((response) => response.json())
    
    .then((responseJson) => {
    
    console.log(" getecombooking1 >>>>>>>>>", responseJson);
    
    
    const func1 = func;
    func1(responseJson);
    
    
    })
    .catch((error) => {
    alert('session expired ! try again ')
    console.error(error);
    
    });
    
    }

}