diff options
author | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-09-15 17:41:31 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communiyschoolnaples.org> | 2018-09-15 17:41:31 -0400 |
commit | fc6efa43834795e4736734bf6abf24ddeacfca00 (patch) | |
tree | 369e481c8e265acf065c0e652a0c932b043d144e /src/actions/firebaseAdmin.js | |
parent | 7073f6545544277673c0806606834225907797d7 (diff) |
Created way to update accounts with username. On signin, it updates the account. Also made some changed to admin console.
Diffstat (limited to 'src/actions/firebaseAdmin.js')
-rw-r--r-- | src/actions/firebaseAdmin.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/actions/firebaseAdmin.js b/src/actions/firebaseAdmin.js index 6009d46..0171fc3 100644 --- a/src/actions/firebaseAdmin.js +++ b/src/actions/firebaseAdmin.js @@ -144,3 +144,13 @@ export const adminApproveHours = (_uid, _time, _id, _path) => (dispatch) => { }); dispatch(adminDeleteRequest(_id, _path)); } + +export const updateUserName = () => (dispatch, getState) => { + var username = getState().firebaseAuth.userEmail.replace('@communityschoolnaples.org', ''); + firestore.collection('users').doc(getState().firebaseAuth.uid) + .update({ + username + }).catch((error) => { + alert(error); + }); +}
\ No newline at end of file |