diff --git a/fittrackee_client/src/actions/user.js b/fittrackee_client/src/actions/user.js index b3921950..a721892d 100644 --- a/fittrackee_client/src/actions/user.js +++ b/fittrackee_client/src/actions/user.js @@ -134,12 +134,16 @@ export const deletePicture = () => dispatch => throw error }) -export const deleteUser = username => dispatch => +export const deleteUser = (username, isAdmin = false) => dispatch => FitTrackeeGenericApi.deleteData('users', username) .then(ret => { if (ret.status === 204) { - dispatch(logout()) - history.push('/') + if (isAdmin) { + history.push('/admin/users') + } else { + dispatch(logout()) + history.push('/') + } } else { ret.json().then(r => dispatch(setError(`${r.message}`))) } diff --git a/fittrackee_client/src/components/App.css b/fittrackee_client/src/components/App.css index 69883f0e..59e75b19 100644 --- a/fittrackee_client/src/components/App.css +++ b/fittrackee_client/src/components/App.css @@ -316,6 +316,15 @@ label { content: " ✔"; } +.fa-as-link { + cursor:pointer; + color: #40578a; +} + +.fa-as-link:hover { + color: #0056b3; +} + .fa-question-circle { color: #6c757d; margin-left: 3px; diff --git a/fittrackee_client/src/components/User/ProfileDetail.jsx b/fittrackee_client/src/components/User/ProfileDetail.jsx index 4f9e703e..8b9dfab3 100644 --- a/fittrackee_client/src/components/User/ProfileDetail.jsx +++ b/fittrackee_client/src/components/User/ProfileDetail.jsx @@ -11,7 +11,9 @@ import { apiUrl, getFileSize } from '../../utils' function ProfileDetail({ appConfig, + displayModal, editable, + isDeletable, message, onDeletePicture, onUploadPicture, @@ -46,6 +48,13 @@ function ProfileDetail({ >