mirror of
https://github.com/hanzoai/helpdesk.git
synced 2026-10-12 16:56:02 +00:00
fix: use get_list for permission-aware article category queries
Restores the knowledge base API change from #3502 (reverted in #3512): get_list enforces user permissions where get_all bypasses them.
This commit is contained in:
@@ -88,7 +88,7 @@ def move_to_category(category: str, articles: list[str]):
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_categories():
|
||||
categories = frappe.get_all(
|
||||
categories = frappe.get_list(
|
||||
"HD Article Category",
|
||||
fields=["name", "category_name", "modified"],
|
||||
)
|
||||
@@ -104,7 +104,7 @@ def get_categories():
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_category_articles(category: str):
|
||||
articles = frappe.get_all(
|
||||
articles = frappe.get_list(
|
||||
"HD Article",
|
||||
filters={"category": category, "status": "Published"},
|
||||
fields=["name", "title", "published_on", "modified", "author", "content"],
|
||||
|
||||
Reference in New Issue
Block a user