From 27f00e1a25549b2a68ab882f218a97fa5368def3 Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Wed, 23 Oct 2024 00:12:35 +0200 Subject: grocy mass edit template fill --- elisp/grocy.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/elisp/grocy.el b/elisp/grocy.el index 2129113..c974cb3 100644 --- a/elisp/grocy.el +++ b/elisp/grocy.el @@ -234,5 +234,22 @@ min_stock_amount: 0 default_best_before_days: -1")) (grocy-buffer-yaml->json (current-buffer))) +;; To do mass edit of things +;; (grocy--request +;; "objects/products" +;; (lambda (_status) +;; (goto-char url-http-end-of-headers) +;; (let ((result (json-parse-buffer))) +;; (with-current-buffer (get-buffer-create "products") +;; (erase-buffer) +;; (emacs-lisp-mode) +;; (mapc +;; (lambda (product) +;; (-let (((&hash "id" "name" "product_group_id") product)) +;; (pp (list :id id :name name :product_group_id product_group_id) (current-buffer)) +;; )) +;; result) +;; (display-buffer (current-buffer)))))) + (provide 'grocy) ;;; grocy.el ends here -- cgit v1.2.3