I have a list of acceptable jobs that a user request (user 1) from their interface and those acceptable jobs are shown to user 2 who can accept those jobs or none at all. Now I have it saving under the specific city from the request, however, within the city node I want it to save under their user ID when they hit the accept button. Therefore, within their UID, the contents of the job will list all its details.
I can't seem to get it working fully.
My JS snippet:
var ref = firebase.database().ref('requests');
var ref2 = firebase.database().ref('Providers').child("City").child("Cincinnati");
ref.on('value', function(snapshot) {
ref2.set(snapshot.val(), function(error) {
});
});
So we're showing the provider the initial request with limited info (which has a ton of info). Once they click 'accept', they're able to view all the info but I'm currently just copying that info into another snapshot.
My question:
How can I save the info under their signed in, user ID (UID)?
The tree is set up like so:
Providers
City
Cincinnati
UID
Job Key ID
Job Details