From 6dc26ca51ff79ea5471069f4af2ea7841bd805e0 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Fri, 25 Apr 2025 15:52:38 +0200 Subject: [PATCH] fix: update spool weight conditionally based on NFC ID --- src/api.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api.cpp b/src/api.cpp index ff8db3a..a8b3e2d 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -167,7 +167,6 @@ bool updateSpoolTagId(String uidString, const char* payload) { // Update Payload erstellen JsonDocument updateDoc; updateDoc["extra"]["nfc_id"] = "\""+uidString+"\""; - if (weight > 10) updateDoc["weight"] = weight; String updatePayload; serializeJson(updateDoc, updatePayload); @@ -195,6 +194,9 @@ bool updateSpoolTagId(String uidString, const char* payload) { updateDoc.clear(); + // Update Spool weight + if (weight > 10) updateSpoolWeight(doc["sm_id"].as(), weight); + return true; }