Skip to content

Commit

Permalink
Merge branch 'main' into BC-6460-one-redis-library
Browse files Browse the repository at this point in the history
  • Loading branch information
blazejpass authored Apr 5, 2024
2 parents e4da1f2 + ff3c4b5 commit a0879f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
5 changes: 0 additions & 5 deletions config/default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
2 changes: 0 additions & 2 deletions config/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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
Expand Down
15 changes: 4 additions & 11 deletions controllers/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) => {
Expand Down

0 comments on commit a0879f0

Please sign in to comment.