Skip to content

Commit dbf87dc

Browse files
committed
feat: follow V5 request body standard for all admin endpoints
- Removed "param" from the "body"
1 parent 5878101 commit dbf87dc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/routes/admin/project-index-create.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ module.exports = [
3333
(req, res, next) => {
3434
const logger = req.log;
3535
logger.debug('Entered Admin#index');
36-
const projectIdStart = Number(req.body.param.projectIdStart);
37-
const projectIdEnd = Number(req.body.param.projectIdEnd);
38-
const indexName = _.get(req, 'body.param.indexName', ES_PROJECT_INDEX);
39-
const docType = _.get(req, 'body.param.docType', ES_PROJECT_TYPE);
36+
const projectIdStart = Number(req.body.projectIdStart);
37+
const projectIdEnd = Number(req.body.projectIdEnd);
38+
const indexName = _.get(req, 'body.indexName', ES_PROJECT_INDEX);
39+
const docType = _.get(req, 'body.docType', ES_PROJECT_TYPE);
4040
logger.debug('projectIdStart', projectIdStart);
4141
logger.debug('projectIdEnd', projectIdEnd);
4242
logger.debug('indexName', indexName);

src/routes/admin/project-index-delete.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ module.exports = [
3232
(req, res, next) => {
3333
const logger = req.log;
3434
logger.debug('Entered Admin#deleteIndex');
35-
const projectIdStart = Number(req.body.param.projectIdStart);
36-
const projectIdEnd = Number(req.body.param.projectIdEnd);
37-
const indexName = _.get(req, 'body.param.indexName', ES_PROJECT_INDEX);
38-
const docType = _.get(req, 'body.param.docType', ES_PROJECT_TYPE);
35+
const projectIdStart = Number(req.body.projectIdStart);
36+
const projectIdEnd = Number(req.body.projectIdEnd);
37+
const indexName = _.get(req, 'body.indexName', ES_PROJECT_INDEX);
38+
const docType = _.get(req, 'body.docType', ES_PROJECT_TYPE);
3939
logger.debug('projectIdStart', projectIdStart);
4040
logger.debug('projectIdEnd', projectIdEnd);
4141
logger.debug('indexName', indexName);

0 commit comments

Comments
 (0)