Initial
This commit is contained in:
14
server/controllers/helpController.js
Normal file
14
server/controllers/helpController.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { getHelpArticle, listHelp } from '../models/helpModel.js';
|
||||
|
||||
export function index(req, res) {
|
||||
res.json(listHelp({
|
||||
query: String(req.query.q || ''),
|
||||
category: String(req.query.category || '')
|
||||
}));
|
||||
}
|
||||
|
||||
export function show(req, res) {
|
||||
const article = getHelpArticle(req.params.id);
|
||||
if (!article) return res.status(404).json({ error: 'Help article not found' });
|
||||
res.json(article);
|
||||
}
|
||||
Reference in New Issue
Block a user