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