diff --git a/client/src/app/admin/panel/staff/staff-editor.js b/client/src/app/admin/panel/staff/staff-editor.js index 0d6d30cf..d218db20 100644 --- a/client/src/app/admin/panel/staff/staff-editor.js +++ b/client/src/app/admin/panel/staff/staff-editor.js @@ -83,8 +83,6 @@ class StaffEditor extends React.Component { } render() { - console.log('State: ', this.state.rawForm); - const { name, level, profilePic, myAccount, staffId, staffList, userId } = this.props; const { message, tickets, loadingPicture, email } = this.state; const myData = _.filter(staffList, {id: `${staffId}`})[0]; diff --git a/client/src/lib-app/api-call.js b/client/src/lib-app/api-call.js index 2b9792ae..3f954636 100644 --- a/client/src/lib-app/api-call.js +++ b/client/src/lib-app/api-call.js @@ -28,7 +28,6 @@ function processData(data, dataAsForm = false) { return newData; } - const randomString = (length) => { var result = ""; var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; @@ -38,6 +37,7 @@ const randomString = (length) => { } return result; }; + export default { call: function ({ path, data, plain, dataAsForm }) { const callId = randomString(3); @@ -57,7 +57,7 @@ export default { resolve(result); } else if (reject) { if (status === "fail" && message === "NO_PERMISSION") { - expiredSessionUtils.checkSessionOrLogOut(); + expiredSessionUtils.checkSessionOrLogOut(processData({})); } reject(result); } diff --git a/client/src/lib-app/expired-session-utils.js b/client/src/lib-app/expired-session-utils.js index 0ec529ee..52bb47cd 100644 --- a/client/src/lib-app/expired-session-utils.js +++ b/client/src/lib-app/expired-session-utils.js @@ -28,8 +28,8 @@ function onSessionExpired(result) { } export default { - checkSessionOrLogOut() { - APIUtils.post(apiRoot + "/user/check-session", {}, {}) + checkSessionOrLogOut(credentialsData) { + APIUtils.post(apiRoot + "/user/check-session", credentialsData, {}) .then(onSessionExpired) .catch((err) => console.error("An error ocurred when checking session: ", err)