Files
poshmanager/server/controllers/helpController.js
2026-06-25 12:05:53 -05:00

15 lines
406 B
JavaScript

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);
}