aboutsummaryrefslogtreecommitdiff
path: root/src/actions/firebaseFirestore.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions/firebaseFirestore.js')
-rw-r--r--src/actions/firebaseFirestore.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/actions/firebaseFirestore.js b/src/actions/firebaseFirestore.js
index 3efeb6a..789d9d3 100644
--- a/src/actions/firebaseFirestore.js
+++ b/src/actions/firebaseFirestore.js
@@ -1,4 +1,4 @@
-import { firestore } from '../firebase.js';
+import { firestore, storage } from '../firebase.js';
export const UPDATE_DIVISON = 'UPDATE_DIVISON';
export const UPDATE_HOURS = 'UPDATE_HOURS';
@@ -104,13 +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,
- picture: _pictureName,
+ imgPath: _imgPath,
uid: _uid,
email: _email
});