aboutsummaryrefslogtreecommitdiff
path: root/src/actions/firebaseFirestore.js
diff options
context:
space:
mode:
authorMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-13 16:30:47 -0400
committerMichael Foiani <mfoiani2019@communiyschoolnaples.org>2018-08-13 16:30:47 -0400
commit3c96bc3f51a97b13c76db305502436d54cc35a6b (patch)
tree63155ba99415a4c1f468557629f604bcd5078c42 /src/actions/firebaseFirestore.js
parentf14bf1edb18b02359fefb61f6d5f342892f7056c (diff)
Fixed bugs with images. It works okay now.
Diffstat (limited to 'src/actions/firebaseFirestore.js')
-rw-r--r--src/actions/firebaseFirestore.js23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/actions/firebaseFirestore.js b/src/actions/firebaseFirestore.js
index 789d9d3..6ce8492 100644
--- a/src/actions/firebaseFirestore.js
+++ b/src/actions/firebaseFirestore.js
@@ -104,24 +104,21 @@ export const requestHours = (_time, _trainee, _location, _subject, _date, _pictu
var docRef = firestore.collection('requests');
const _uid = getState().firebaseAuth.uid;
const _email = getState().firebaseAuth.userEmail;
- var _imgPath = "";
var storageRef = storage.ref().child('requests/' + _uid + '/' + _pictureName);
storageRef.getDownloadURL().then((url) => {
- _imgPath = url;
+ docRef.add({
+ time: _time,
+ trainee: _trainee,
+ location: _location,
+ subject: _subject,
+ day: _date,
+ imgPath: url,
+ uid: _uid,
+ email: _email
+ });
});
-
- docRef.add({
- time: _time,
- trainee: _trainee,
- location: _location,
- subject: _subject,
- day: _date,
- imgPath: _imgPath,
- uid: _uid,
- email: _email
- });
}
export const registerComp = (compName) => (dispatch, getState) => {