From cf1cae9b84cab4c3e45ebd368c928e267ee6c93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 25 May 2021 19:08:57 +0200 Subject: [PATCH] fix: Project actions need to checkAccess based on projectId --- frontend/src/component/project/ProjectList/ProjectList.jsx | 6 +++--- frontend/src/component/project/create-project-container.js | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/src/component/project/ProjectList/ProjectList.jsx b/frontend/src/component/project/ProjectList/ProjectList.jsx index 192445b950..a9e1d26f02 100644 --- a/frontend/src/component/project/ProjectList/ProjectList.jsx +++ b/frontend/src/component/project/ProjectList/ProjectList.jsx @@ -98,7 +98,7 @@ const ProjectList = ({ projects, fetchProjects, removeProject, history }) => { const renderProjectList = () => projects.map(project => ( - + folder_open @@ -107,11 +107,11 @@ const ProjectList = ({ projects, fetchProjects, removeProject, history }) => { secondary={project.description} /> diff --git a/frontend/src/component/project/create-project-container.js b/frontend/src/component/project/create-project-container.js index 62e80ba5ff..54e05b02e9 100644 --- a/frontend/src/component/project/create-project-container.js +++ b/frontend/src/component/project/create-project-container.js @@ -1,6 +1,7 @@ import { connect } from 'react-redux'; import ProjectComponent from './form-project-component'; import { createProject, validateId } from './../../store/project/actions'; +import { fetchUser } from './../../store/user/actions'; const mapStateToProps = () => ({ project: { id: '', name: '', description: '' }, @@ -8,7 +9,10 @@ const mapStateToProps = () => ({ const mapDispatchToProps = dispatch => ({ validateId, - submit: project => createProject(project)(dispatch), + submit: async project => { + await createProject(project)(dispatch); + fetchUser()(dispatch); + }, editMode: false, });