Skip to content

Commit

Permalink
Merge pull request #294 from graasp/281/persistSavedSpaces
Browse files Browse the repository at this point in the history
fix: remove space in classroom instead of in saved spaces
  • Loading branch information
juancarlosfarah authored Jul 7, 2020
2 parents 830bd42 + 0434c50 commit d498c97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions public/app/listeners/loadSpaceInClassroom.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const {
USERS_COLLECTION,
} = require('../db');
const { renameSpaceFolder } = require('./loadSpace');
const { deleteSpaceAndResources } = require('./deleteSpace');
const { addUserInClassroomDatabase } = require('./addUserInClassroom');

const loadSpaceInClassroom = (mainWindow, db) => async (
Expand Down Expand Up @@ -111,7 +110,10 @@ const loadSpaceInClassroom = (mainWindow, db) => async (
}

// remove previous space
deleteSpaceAndResources(db, id, tmpPath);
classroom
.get(SPACES_COLLECTION)
.remove({ id })
.write();

// add new space in database
classroom
Expand Down

0 comments on commit d498c97

Please sign in to comment.