Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

save to db

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

save to db

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

save to db

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

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

Thanks marina,
here are the screenshots

Image

Image

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

save to db

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.

Michael4771079
Posts: 0
Joined: Sat Jul 21, 2012 2:03 pm

save to db

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

Return to “Issues”