mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 11:39:36 +02:00
Fetch and use custom search queries
This commit is contained in:
parent
da928f20a2
commit
591824dd0c
9 changed files with 136 additions and 80 deletions
|
@ -162,7 +162,7 @@ exports.getCss = asyncWrapper(async (req, res, next) => {
|
|||
// @access Public
|
||||
exports.updateCss = asyncWrapper(async (req, res, next) => {
|
||||
const file = new File(join(__dirname, '../public/flame.css'));
|
||||
file.write(req.body.styles);
|
||||
file.write(req.body.styles, false);
|
||||
|
||||
// Copy file to docker volume
|
||||
fs.copyFileSync(
|
||||
|
@ -175,3 +175,16 @@ exports.updateCss = asyncWrapper(async (req, res, next) => {
|
|||
data: {},
|
||||
});
|
||||
});
|
||||
|
||||
// @desc Get custom queries file
|
||||
// @route GET /api/config/0/queries
|
||||
// @access Public
|
||||
exports.getQueries = asyncWrapper(async (req, res, next) => {
|
||||
const file = new File(join(__dirname, '../data/customQueries.json'));
|
||||
const content = JSON.parse(file.read());
|
||||
|
||||
res.status(200).json({
|
||||
success: true,
|
||||
data: content.queries,
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue