Boutique - 13. Register a new Customer

Hi. I am watching youtube tutorial and I've stucked on Register a new Customer stage.
I've watched 5times and I think I didn't miss on the video.. but
when I click "Register" Button, nothing is changed. the modal is kept opened.
and doing nothing.

any idea? what should I do?

Thanks in advance.

You need to make sure the Type of the 'Register' button is set as 'Type: Submit' in the properties panel (lower right of your screen), like this:

image

bHi. @TMR Yes. I did. but the same. not working.
and if you see the video on youtube 15:48, the type of button is "button"
image

However, it is not working even though edit as submit.

Thanks.

In your form properties, have you selected 'server connect form' - like this?

Is there a record being added to the database?

image

Yes. It is.

Is a record being added to the database?

No. I also checked that point if it was recorded.. but no...

Take a look at your browser dev console for any errors, if on a windows machine, hit Ctrl+F12 to open it.

not sure..where and what to change...

It says Unauthorized.....is that right? on Upsert API.....
how to fix.....if it is the cause..

1 Like

You are nearly there, take a look at this quick tutorial and it'll explain what you need to know to debug that error - you'll have this fixed quickly..

It say "null" But I filled all input fields....

Try clicking on the blue circle at the bottom right of the screen here:

I think it is the message that you've tried to guide me..
But I am a real beginner so...still don't know what and where to fix..


click the 'preview' and 'response' to find out more, here:

image

It says. null

Not actually familiar with that bit of video but "unauthorised" errors normally result from trying to perform a server action which you are not authorised to perform.
Are you logged in?
Is there a security restrict in the api action and if so, is it set correctly.

EDIT Sorry, didnt notice the API flow you posted,those unauthorised errors are generated by a number of checks on variables.

Hi. I am just following the video.... I think I didn't logged-in.
and security restrict is not mentioned during the video.

Thanks.

There are 3 places where your return a 401 (unauthorised) response in the action based on conditions. You need to check those values are correct

POST.id >=0
POST.position.length()>0
And
POST.title != $_SESSION.mykey

You need to check those values.

Gut feeling is you may have not set $_SESSION.mykey properly (based solely on fact that is an easy mistake to make).
I am guessing that is set elsewhere?

Yes. I've set them.
But, still not working.

i see these message.


But I filling them all.

Scroll up and look at your Input settings under $_POST in your API - you should see a list of form fields that are being received by the form. Can you take a screenshot of that please?