I'm a paragraph. Click here to add your own text and edit me. It's easy.

import { authentication } from 'wix-members';

import wixData from 'wix-data';

 

$w.onReady(function () {

 

});

 

export function regBtn_click(event) {

    $w('#resultText').hide();

    const mail = $w('#email').value;

    const pass = $w('#password').value;

    authentication.register(mail, pass).then(() => {

        wixData.save('Test', { title: 'test succeeded' })

            .then(() => {

                $w('#resultText').text = 'Test succeeded';

                $w('#resultText').show();

            })

            .catch(err => {

                $w('#resultText').text = err.message;

                $w('#resultText').show();

            })

    })

}