From: Paul Hänsch Date: Sat, 11 May 2024 15:05:01 +0000 (+0200) Subject: enable deletion of ledgers X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=acf7b97ca0deee3e2d2cf328e7c3951d57ea8a2f;p=confetti enable deletion of ledgers --- diff --git a/ledgers/delete.sh b/ledgers/delete.sh new file mode 100755 index 0000000..7b41921 --- /dev/null +++ b/ledgers/delete.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +delete="$(POST delete |PATH)" +dtable="${_DATA}/ledgers/${delete##*/}" + +if [ "$dtable" ]; then + rm -- "${dtable}" \ + || SET_COOKIE 0 message="Unable to delete ledger: \"$(HTML "$delete")\"" +else + SET_COOKIE 0 message="No such ledger: \"$(HTML "$delete")\"" +fi + +REDIRECT "${_BASE}/ledgers/"