-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from saranshbalyan-1234/3
3
- Loading branch information
Showing
115 changed files
with
2,461 additions
and
2,199 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,33 +1,31 @@ | ||
import getError from '#utils/error.js'; | ||
import { permissionList } from '#constants/permission.js'; | ||
import { actionEvents } from '#constants/actionEvents.js'; | ||
import { permissionList } from '#constants/permission.js'; | ||
import getError from '#utils/error.js'; | ||
|
||
const getAllPermission = async (req, res) => { | ||
/* #swagger.tags = ["Constant"] | ||
#swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
const getAllPermission = (req, res) => { | ||
/* | ||
* #swagger.tags = ["Constant"] | ||
* #swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
try { | ||
const data = permissionList.sort((a, b) => { | ||
return a.name > b.name ? 1 : -1; | ||
}); | ||
const data = permissionList.sort((a, b) => a.name > b.name ? 1 : -1); | ||
return res.status(200).json(data); | ||
} catch (error) { | ||
getError(error, res); | ||
} | ||
}; | ||
|
||
const getAllActionEvent = async (req, res) => { | ||
/* #swagger.tags = ["Constant"] | ||
#swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
const getAllActionEvent = (req, res) => { | ||
/* | ||
* #swagger.tags = ["Constant"] | ||
* #swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
try { | ||
const data = actionEvents.sort((a, b) => { | ||
return a.name > b.name ? 1 : -1; | ||
}); | ||
const data = actionEvents.sort((a, b) => a.name > b.name ? 1 : -1); | ||
return res.status(200).json(data); | ||
} catch (error) { | ||
getError(error, res); | ||
} | ||
}; | ||
|
||
export { getAllPermission, getAllActionEvent }; | ||
export { getAllActionEvent, getAllPermission }; |
This file contains 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 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 |
---|---|---|
@@ -1,28 +1,33 @@ | ||
import getError from '#utils/error.js'; | ||
import { encryptWithAES, decryptWithAES } from '../Service/aes.service.js'; | ||
|
||
const encryptData = async (req, res) => { | ||
/* #swagger.tags = ["Encryption"] | ||
#swagger.security = [{"apiKeyAuth": []}] */ | ||
import { decryptWithAES, encryptWithAES } from '../Service/aes.service.js'; | ||
|
||
const encryptData = (req, res) => { | ||
/* | ||
* #swagger.tags = ["Encryption"] | ||
* #swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
try { | ||
const data = req.body.data; | ||
const { data } = req.body; | ||
const encrypted = encryptWithAES(data); | ||
return res.status(200).json(encrypted); | ||
} catch (error) { | ||
getError(error, res); | ||
} | ||
}; | ||
|
||
const decryptData = async (req, res) => { | ||
/* #swagger.tags = ["Encryption"] | ||
#swagger.security = [{"apiKeyAuth": []}] */ | ||
const decryptData = (req, res) => { | ||
/* | ||
* #swagger.tags = ["Encryption"] | ||
* #swagger.security = [{"apiKeyAuth": []}] | ||
*/ | ||
try { | ||
const encrypted = req.body.encrypted; | ||
const { encrypted } = req.body; | ||
const decrypted = decryptWithAES(encrypted); | ||
return res.status(200).json(decrypted); | ||
} catch (error) { | ||
getError(error, res); | ||
} | ||
}; | ||
|
||
export { encryptData, decryptData }; | ||
export { decryptData, encryptData }; |
This file contains 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 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.