-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reference pull request for full details.
- Loading branch information
1 parent
a1b4b49
commit 00005e0
Showing
25 changed files
with
11,649 additions
and
10,059 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
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
!####################################################################### | ||
! C-PATTM SOFTWARE | ||
! CRANE C-PATTM plan of action and milestones software. Use is governed by the Open Source Academic Research License Agreement contained in the file | ||
! crane_C_PAT.1_license.txt, which is part of this software package. BY | ||
! USING OR MODIFYING THIS SOFTWARE, YOU ARE AGREEING TO THE TERMS AND | ||
! CONDITIONS OF THE LICENSE. | ||
!######################################################################## | ||
*/ | ||
|
||
const operationService = require('../Services/mysql/operationService'); | ||
const config = require('../utils/config'); | ||
module.exports.getConfiguration = async function getConfiguration(req, res, next) { | ||
try { | ||
let dbConfigs = await operationService.getConfiguration() | ||
let version = { version: config.version } | ||
let response = { ...version, ...dbConfigs } | ||
res.json(response) | ||
} | ||
catch (err) { | ||
next(err); | ||
} | ||
} | ||
|
||
module.exports.setConfigurationItem = async function setConfigurationItem(req, res, next) { | ||
try { | ||
const { key, value } = req.body; | ||
if (!key || !value) { | ||
return res.status(400).json({ error: 'Key and value are required.' }); | ||
} | ||
|
||
await operationService.setConfigurationItem(key, value); | ||
res.json({ message: 'Configuration item updated successfully.' }); | ||
|
||
} catch (err) { | ||
next(err); | ||
} | ||
}; | ||
|
||
module.exports.deleteConfigurationItem = async function deleteConfigurationItem(req, res, next) { | ||
try { | ||
const { key } = req.params; | ||
|
||
if (!key) { | ||
return res.status(400).json({ error: 'Key is required.' }); | ||
} | ||
|
||
await operationService.deleteConfigurationItem(key); | ||
res.json({ message: 'Configuration item deleted successfully.' }); | ||
} catch (err) { | ||
next(err); | ||
} | ||
}; |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.