diff --git a/config/default.schema.json b/config/default.schema.json index ff0addccd7..2e220e063a 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -602,11 +602,6 @@ "type": "boolean", "default": false, "description": "Enables to get groups of type class in courses" - }, - "FEATURE_NEST_SYSTEMS_API_ENABLED": { - "type": "boolean", - "default": true, - "description": "Uses the v3 api over the v1 api for systems" } }, "allOf": [ diff --git a/config/global.js b/config/global.js index 38a81cdfb4..738efbfe1a 100644 --- a/config/global.js +++ b/config/global.js @@ -41,7 +41,6 @@ const { FEATURE_BUTTONS_ON_LOGINPAGE_ENABLED, FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED, FEATURE_GROUPS_IN_COURSE_ENABLED, - FEATURE_NEST_SYSTEMS_API_ENABLED, } = process.env; const exp = { @@ -85,7 +84,6 @@ const exp = { FEATURE_BUTTONS_ON_LOGINPAGE_ENABLED, FEATURE_SHOW_NEW_CLASS_VIEW_ENABLED, FEATURE_GROUPS_IN_COURSE_ENABLED, - FEATURE_NEST_SYSTEMS_API_ENABLED, }; // eslint-disable-next-line no-console diff --git a/controllers/administration.js b/controllers/administration.js index 1ae06b2b9a..0791f7c3a3 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -21,7 +21,7 @@ const timesHelper = require('../helpers/timesHelper'); const router = express.Router(); const upload = multer({ storage: multer.memoryStorage() }); -const { HOST, CONSENT_WITHOUT_PARENTS_MIN_AGE_YEARS, FEATURE_NEST_SYSTEMS_API_ENABLED } = require('../config/global'); +const { HOST, CONSENT_WITHOUT_PARENTS_MIN_AGE_YEARS } = require('../config/global'); const { isUserHidden } = require('../helpers/users'); const renameIdsInSchool = require('../helpers/schoolHelper'); @@ -483,16 +483,10 @@ const getDeleteHandler = (service, redirectUrl, apiVersion = 'v1') => function d }; const removeSystemFromSchoolHandler = (req, res, next) => { - api(req) - .patch(`/schools/${res.locals.currentSchool}`, { - json: { - $pull: { - systems: req.params.id, - }, - }, - }) + api(req, { version: 'v3' }) + .patch(`school/${res.locals.currentSchool}/system/${req.params.id}/remove/`) .then(() => { - next(); + redirectHelper.safeBackRedirect(req, res); }) .catch((err) => { next(err); @@ -2766,7 +2760,6 @@ router.get('/systems/:id', getDetailHandler('systems')); router.delete( '/systems/:id', removeSystemFromSchoolHandler, - getDeleteHandler('systems', undefined, FEATURE_NEST_SYSTEMS_API_ENABLED === 'true' ? 'v3' : 'v1'), ); router.get('/rss/:id', async (req, res) => {