adjustment of the project object property 'shared'

This commit is contained in:
Delucse
2020-12-08 20:15:54 +01:00
parent 3cf7f10d34
commit a4cf0d32b0
6 changed files with 26 additions and 26 deletions
+2 -5
View File
@@ -113,7 +113,7 @@ export const deleteProject = (type, id) => (dispatch, getState) => {
axios.delete(`${process.env.REACT_APP_BLOCKLY_API}/${type}/${id}`)
.then(res => {
var projects = getState().project.projects;
var index = projects.findIndex(res => res._id === id || res._id._id === id);
var index = projects.findIndex(res => res._id === id);
projects.splice(index, 1)
dispatch({
type: GET_PROJECTS,
@@ -148,10 +148,7 @@ export const shareProject = (title, type, id) => (dispatch, getState) => {
if(body.projectId){
var projects = getState().project.projects;
var index = projects.findIndex(res => res._id === id);
projects[index]._id = {
_id: shareContent._id,
expiresAt: shareContent.expiresAt
};
projects[index].shared = shareContent.expiresAt;
dispatch({
type: GET_PROJECTS,
payload: projects