[#1532] Update project when deleting file
This commit is contained in:
parent
2948412a33
commit
3aa26120c2
2 changed files with 4 additions and 3 deletions
|
@ -160,7 +160,8 @@ export function deleteFile(id, parentId) {
|
|||
}
|
||||
};
|
||||
apiClient.delete(`/projects/${state.project.id}/files/${id}`, deleteConfig)
|
||||
.then(() => {
|
||||
.then((response) => {
|
||||
dispatch(setProjectSavedTime(response.data.project.updatedAt));
|
||||
dispatch({
|
||||
type: ActionTypes.DELETE_FILE,
|
||||
id,
|
||||
|
|
|
@ -103,8 +103,8 @@ export function deleteFile(req, res) {
|
|||
const idsToDelete = getAllDescendantIds(project.files, req.params.file_id);
|
||||
deleteMany(project.files, [req.params.file_id, ...idsToDelete]);
|
||||
project.files = deleteChild(project.files, req.query.parentId, req.params.file_id);
|
||||
project.save((innerErr) => {
|
||||
res.json(project.files);
|
||||
project.save((innerErr, savedProject) => {
|
||||
res.json({ project: savedProject });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue