Files
poshmanager/server/models/helpModel.js
2026-06-25 12:05:53 -05:00

21 lines
571 B
JavaScript

import { helpCatalog, helpCategories, helpSearch } from '../data/helpCatalog.js';
export function listHelp({ query = '', category = '' } = {}) {
const articles = helpSearch(query, category);
return {
categories: helpCategories(),
total: articles.length,
articles: articles.map((item) => ({
id: item.id,
category: item.category,
title: item.title,
summary: item.summary,
tags: item.tags || []
}))
};
}
export function getHelpArticle(articleId) {
return helpCatalog().find((item) => item.id === articleId) || null;
}