From 19033b8460cb43dc2fa34a2cffa932b5efe111ca Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sat, 19 Aug 2017 15:39:58 +0200 Subject: Add profile page --- src/actions/profile.js | 14 ++++++++++++++ src/actions/users.js | 18 ++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/actions/profile.js (limited to 'src/actions') diff --git a/src/actions/profile.js b/src/actions/profile.js new file mode 100644 index 00000000..421e7602 --- /dev/null +++ b/src/actions/profile.js @@ -0,0 +1,14 @@ +export const OPEN_DELETE_PROFILE_MODAL = "OPEN_DELETE_PROFILE_MODAL"; +export const CLOSE_DELETE_PROFILE_MODAL = "CLOSE_DELETE_PROFILE_MODAL"; + +export function openDeleteProfileModal() { + return { + type: OPEN_DELETE_PROFILE_MODAL + }; +} + +export function closeDeleteProfileModal() { + return { + type: CLOSE_DELETE_PROFILE_MODAL + }; +} diff --git a/src/actions/users.js b/src/actions/users.js index 093adddd..04a5b95a 100644 --- a/src/actions/users.js +++ b/src/actions/users.js @@ -1,5 +1,7 @@ export const FETCH_AUTHORIZATIONS_OF_CURRENT_USER = "FETCH_AUTHORIZATIONS_OF_CURRENT_USER"; export const FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED = "FETCH_AUTHORIZATIONS_OF_CURRENT_USER_SUCCEEDED"; +export const DELETE_CURRENT_USER = "DELETE_CURRENT_USER"; +export const DELETE_CURRENT_USER_SUCCEEDED = "DELETE_CURRENT_USER_SUCCEEDED"; export function fetchAuthorizationsOfCurrentUser() { return (dispatch, getState) => { @@ -17,3 +19,19 @@ export function fetchAuthorizationsOfCurrentUserSucceeded(authorizationsOfCurren authorizationsOfCurrentUser }; } + +export function deleteCurrentUser() { + return (dispatch, getState) => { + const {auth} = getState(); + dispatch({ + type: DELETE_CURRENT_USER, + userId: auth.userId + }); + }; +} + +export function deleteCurrentUserSucceeded() { + return { + type: DELETE_CURRENT_USER_SUCCEEDED + }; +} -- cgit v1.2.3