
const btn = document.getElementById('btn');
const liffId = '1656372900-VM6wDmamDDDDD';
let userId = '';

function main(){
    liff.init({liffId: liffId});
    liff.ready.then(() => {
        if(!liff.isLoggedIn()){
            liff.login();
        }
        liff.getProfile().then(profile => {
            console.log(profile);
        })
    });
}

main()

async function send(e){
    e.prevenDefault();
    const firstname = document.getElementById('firstname').value;
    const lastname = document.getElementById('lastname').value;
    const email = document.getElementById('email').value;
    
    // try {
    //     const result = await axios.post('http://localhost:3000/api/v1/change-richmenu', {
    //         firstname: firstname,
    //         lastname: lastname,
    //         email: email,
    //         userId: userId
    //     });        
    //     if(result.status == 200){
    //         console.log("closeWindow");
    //         // liff.closeWindow();
    //     }
    // } catch (error) {
    //     console.log(error);
    // }  
}

