Skip to content

Commit

Permalink
fix(routes): fix routes parameter calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ruidias-commercetools committed Jul 22, 2024
1 parent f91c4fe commit cfd445a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { post } from '../controllers/event.controller.js';

const eventRouter = Router();

eventRouter.post('/', async (req, res, next) => {
eventRouter.post('/', (req, res, next) => {
logger.info('Event message received');

try {
await post(req.body);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down
5 changes: 2 additions & 3 deletions application-templates/javascript/job/src/routes/job.route.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { post } from '../controllers/job.controller.js';
// Create the router for our app
const jobRouter = Router();

jobRouter.post('/', async (req, res, next) => {
jobRouter.post('/', (req, res, next) => {
try {
await post(req, res);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { post } from '../controllers/service.controller.js';

const serviceRouter = Router();

serviceRouter.post('/', async (req, res, next) => {
serviceRouter.post('/', (req, res, next) => {
logger.info('Cart update extension executed');

try {
// Add your custom logic here
await post(req.body);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { post } from '../controllers/event.controller';

const eventRouter: Router = Router();

eventRouter.post('/', async (req, res, next) => {
eventRouter.post('/', (req, res, next) => {
logger.info('Event message received');
try {
await post(req, res);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down
5 changes: 2 additions & 3 deletions application-templates/typescript/job/src/routes/job.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import { post } from '../controllers/job.controller';
// Create the router for our app
const jobRouter: Router = Router();

jobRouter.post('/', async (req, res, next) => {
jobRouter.post('/', (req, res, next) => {
try {
await post(req, res);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ import { post } from '../controllers/service.controller';

const serviceRouter = Router();

serviceRouter.post('/', async (req, res, next) => {
serviceRouter.post('/', (req, res, next) => {
logger.info('Service post message received');

try {
await post(req, res);
res.status(200).send();
post(req, res);
} catch (error) {
next(error);
}
Expand Down

0 comments on commit cfd445a

Please sign in to comment.