Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make route conform to HTTP standard #314

Open
Naapperas opened this issue Apr 8, 2023 · 0 comments
Open

Make route conform to HTTP standard #314

Naapperas opened this issue Apr 8, 2023 · 0 comments
Labels
maintenance P2 Low priority

Comments

@Naapperas
Copy link
Member

Since this is a GET request:

router.get("/:companyId/hasReachedMaxConcurrentOffersBetweenDates",
or([
authMiddleware.isCompany,
authMiddleware.isAdmin,
authMiddleware.isGod,
], { status_code: HTTPStatus.UNAUTHORIZED, error_code: ErrorTypes.FORBIDDEN, msg: ValidationReasons.INSUFFICIENT_PERMISSIONS }),
validators.checkConcurrent,
validators.setDefaultValuesConcurrent,
(req, res, next) => companyMiddleware.canManageAccountSettings(req.params.companyId)(req, res, next),
async (req, res, next) => {
try {
const maxNotReached = await concurrentOffersNotExceeded(Offer)(
req.params.companyId,
req.body.publishDate,
req.body.publishEndDate
);

any data passed in should come from the query. There are other matters such as making the endpoint idempotent (not sure if it is already) but that is the main one.

@Naapperas Naapperas added maintenance P2 Low priority labels Apr 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance P2 Low priority
Projects
None yet
Development

No branches or pull requests

1 participant