Page 1 of 5

save to db

Posted: Mon Mar 25, 2013 2:37 pm
by Michael4771079

Hi,
I have added a login and reg db to my app,
I have added 4 columns to db, addresses, name, email,mobile
all of these are currently saved in local storage

how do I save these items to db


save to db

Posted: Mon Mar 25, 2013 2:44 pm
by Michael4771079

save to db

Posted: Mon Mar 25, 2013 2:54 pm
by Maryna Brodina

save to db

Posted: Mon Mar 25, 2013 3:30 pm
by Michael4771079

sorry Marina,
I wasn't clear with my question
I have the login and register working when user logs in , on success he is taken to profile sereen, on this screen I want to save on click the 3 inputs to the db, which is where I add the columns

Image


save to db

Posted: Mon Mar 25, 2013 4:58 pm
by Kateryna Grynko

Hi Michael,

Database Login service in Response parameters contains parameter _id. This is a unique user id. You should map this parameter to LocalStorage variable userId.
To change user parameters you should create the following Rest Service:
codeURL = {database_url}/users/{object_id}
Method = PUT
Settings = choose database settings from the dropdown list./code
Image

Then create Request parameters:
codeX-Tiggzi-Database-Id = {database_id}
X-Tiggzi-Session-Token
object_id
addresses
name
email/codeaddresses, name and email are the columns in users collection that you want to change.

Image

Then you can use the service to save user parameters in the app. Map localStorage variable userId value to request parameter object_id.


save to db

Posted: Tue Mar 26, 2013 1:22 pm
by Michael4771079

Hi,
I have followed the details above but I am not getting updated in database,

I am able to register and login, but the added columns are empty i.e

addresses,name,email and mobile


save to db

Posted: Tue Mar 26, 2013 1:31 pm
by Maryna Brodina

Hello! Could you send us your mapping screenshot, also screenshots with service settings/request parameters?


save to db

Posted: Tue Mar 26, 2013 1:47 pm
by Michael4771079

Thanks marina,
here are the screenshots

Image

Image

Image


save to db

Posted: Tue Mar 26, 2013 3:35 pm
by Kateryna Grynko

Hi Michael,

As I can see, you created the correct Rest Service for saving data to Database.
You should call service "user_update" and as Request parameters addresses, name, mobile use the values you want to save in Database.


save to db

Posted: Tue Mar 26, 2013 4:23 pm
by Michael4771079

Thanks Katya,
I have called service onclick,
selected service and edited mapping, got the following error in console

here are some screenshots, hope this helps

Image

Image

Image