]> git.plutz.net Git - invoices/blobdiff - senders.sh
use transaction id for all updates
[invoices] / senders.sh
index 90c3d3815b49fde8179d73bcecf860bc3e956874..4d1f6121661d56c79f81ec5e1d563dc470d5cb94 100755 (executable)
@@ -19,10 +19,11 @@ xxx / 000 / ###
     [form method="POST" action="/update_sender"
       [hidden "id" "%s"]
       <textarea name="address" placeholder="address">%s</textarea>
-      [submit "update" "update" Update]
+      [submit "update" "%s" Update]
     ]' \
     "$(HTML $id)" \
-    "$(HTML "${address}")"
+    "$(HTML "${address}")" \
+    "$(tid "senders/$id")"
 }
 
 list_senders(){
@@ -37,8 +38,11 @@ list_senders(){
 
 update_sender(){
   id="$(POST id |checkid)"
-  if [ "$(POST update)" = update -a "$id" ]; then
+  if [ "$(POST update)" = "$(tid "senders/$id")" ]; then
     mkdir -p senders
     POST address >"senders/$id"
+    REDIRECT "/senders/"
+  else
+    REDIRECT "/senders/$id"
   fi
 }