From acf7b97ca0deee3e2d2cf328e7c3951d57ea8a2f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Sat, 11 May 2024 17:05:01 +0200 Subject: [PATCH] enable deletion of ledgers --- ledgers/delete.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 ledgers/delete.sh 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/" -- 2.39.2