generated from RealDevSquad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 280
feat: implement OOO acknowledgement functionality #2471
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
402cc8b
initial commit
RishiChaubey31 3666b9d
fix-services-ooorequest-test
RishiChaubey31 9a9926e
Merge remote-tracking branch 'origin/develop' into feature/ooo-req-ac…
RishiChaubey31 303a1d7
fix-module-imports
RishiChaubey31 e046d74
refactor: streamline OOO request handling and enhance validation
RishiChaubey31 dcffdca
feat: enhance OOO request creation with user role validation
RishiChaubey31 1f8b831
fix-getRequestByID-function
RishiChaubey31 03d3198
fix-validator-name
RishiChaubey31 16b90ba
refactor: remove redundant request constants from REQUEST_LOG_TYPE
RishiChaubey31 d94bbda
fix-ooo-models-condtions
RishiChaubey31 602a0bb
refactor: enhance OOO request handling and validation
RishiChaubey31 d608d9c
refactor: update error handling in OOO request service
RishiChaubey31 9ad3048
fix/function-name
RishiChaubey31 577cef8
fix/spaces
RishiChaubey31 f4ff103
refactor: simplify variable usage in acknowledgeOooRequest
RishiChaubey31 f1bfe6a
refactor: rename acknowledgeOooRequest for consistency
RishiChaubey31 b2fb635
refactor: update acknowledgeOooRequest to improve clarity and maintai…
RishiChaubey31 f47848a
refactor: enhance type handling in acknowledgeOooRequest
RishiChaubey31 ed7e062
Merge branch 'develop' into feature/ooo-req-acknowledgement
MayankBansal12 baad820
fix-nested-loop-refactor
RishiChaubey31 ea2222c
fix/change-conflict-to-badrequest
RishiChaubey31 6e63df6
refactor: improve oooRoleCheckMiddleware and oooRequests validation
RishiChaubey31 ac47140
fix-jsdoc
RishiChaubey31 4a6ccb3
refactor: improve error handling and type safety in oooRequests
RishiChaubey31 c362646
feat: tests for OOO acknowledgement feature (#2474)
RishiChaubey31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { NextFunction } from "express"; | ||
| import { CustomRequest, CustomResponse } from "../types/global"; | ||
| import { REQUEST_TYPE } from "../constants/requests"; | ||
| import { devFlagMiddleware } from "./devFlag"; | ||
| import authorizeRoles from "./authorizeRoles"; | ||
|
|
||
| const { SUPERUSER } = require("../constants/roles"); | ||
|
|
||
| export const oooRoleCheckMiddleware = ( | ||
| req: CustomRequest, | ||
| res: CustomResponse, | ||
| next: NextFunction | ||
| ) => { | ||
| const requestType = req.body?.type; | ||
|
|
||
| if (requestType === REQUEST_TYPE.OOO) { | ||
| // TODO: Remove this middleware once the OOO feature is tested and ready | ||
| return devFlagMiddleware(req, res, (err) => { | ||
| if (err) return next(err); | ||
|
|
||
| try { | ||
| return authorizeRoles([SUPERUSER])(req, res, next); | ||
| } catch (authErr) { | ||
| return next(authErr); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| return next(); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.