Skip to content

Commit

Permalink
refactor: Wrap meta in v2 (#26548)
Browse files Browse the repository at this point in the history
(cherry picked from commit 750b70b)
  • Loading branch information
ankush authored and mergify[bot] committed May 24, 2024
1 parent 30f767e commit 02ec560
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion frappe/api/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ def delete_doc(doctype: str, name: str):
return "ok"


def get_meta(doctype: str):
frappe.only_for("All")
return frappe.get_meta(doctype)


def execute_doc_method(doctype: str, name: str, method: str | None = None):
"""Get a document from DB and execute method on it.
Expand Down Expand Up @@ -188,6 +193,6 @@ def run_doc_method(method: str, document: dict[str, Any] | str, kwargs=None):
endpoint=execute_doc_method,
),
# Collection level APIs
Rule("/doctype/<doctype>/meta", methods=["GET"], endpoint=frappe.get_meta),
Rule("/doctype/<doctype>/meta", methods=["GET"], endpoint=get_meta),
Rule("/doctype/<doctype>/count", methods=["GET"], endpoint=count),
]

0 comments on commit 02ec560

Please sign in to comment.