diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:47:34 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-08-13 16:47:34 -0400 |
commit | 717352f8653a71eba003ec33dfa6355463208045 (patch) | |
tree | 62ec6ae72a58d4ab80565e2f4b9cf6b20fb9654f /src/actions/firebaseFirestore.js | |
parent | 3c96bc3f51a97b13c76db305502436d54cc35a6b (diff) |
Now deletes img from storage after use. Done with basic img backend stuff.
Diffstat (limited to 'src/actions/firebaseFirestore.js')
-rw-r--r-- | src/actions/firebaseFirestore.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/actions/firebaseFirestore.js b/src/actions/firebaseFirestore.js index 6ce8492..a95e0c8 100644 --- a/src/actions/firebaseFirestore.js +++ b/src/actions/firebaseFirestore.js @@ -104,8 +104,9 @@ export const requestHours = (_time, _trainee, _location, _subject, _date, _pictu var docRef = firestore.collection('requests'); const _uid = getState().firebaseAuth.uid; const _email = getState().firebaseAuth.userEmail; + const _path = 'requests/' + _uid + '/' + _pictureName; - var storageRef = storage.ref().child('requests/' + _uid + '/' + _pictureName); + var storageRef = storage.ref().child(_path); storageRef.getDownloadURL().then((url) => { docRef.add({ time: _time, @@ -113,7 +114,8 @@ export const requestHours = (_time, _trainee, _location, _subject, _date, _pictu location: _location, subject: _subject, day: _date, - imgPath: url, + imgUrl: url, + path: _path, uid: _uid, email: _email }); |