Skip to content

Commit

Permalink
fix: remove space in classroom instead of in saved spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
pyphilia committed Jul 6, 2020
1 parent 84012d6 commit 0434c50
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 0434c50

Please sign in to comment.