feat(skill): cover full API — projects, delete, health, all WorkCreate fields
All checks were successful
ci / build-test-push (push) Successful in 1m26s
All checks were successful
ci / build-test-push (push) Successful in 1m26s
This commit is contained in:
20
skill/bin/wq_delete
Executable file
20
skill/bin/wq_delete
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# wq_delete — cancel a work item (sets status=cancelled)
|
||||
# Usage: wq delete <work_item_id>
|
||||
|
||||
API_URL="${WORK_QUEUE_API_URL:-}"
|
||||
[[ -z "$API_URL" ]] && API_URL=$(cat ~/.config/work_queue_api_url 2>/dev/null || echo "")
|
||||
[[ -z "$API_URL" ]] && { echo "Error: WORK_QUEUE_API_URL not set" >&2; exit 1; }
|
||||
|
||||
work_id="$1"
|
||||
[[ -z "$work_id" ]] && { echo "Usage: wq delete <work_item_id>" >&2; exit 1; }
|
||||
|
||||
response=$(curl -sf -X DELETE "$API_URL/work/$work_id" -w "\n%{http_code}")
|
||||
http_code=$(echo "$response" | tail -1)
|
||||
body=$(echo "$response" | head -1)
|
||||
|
||||
if [[ "$http_code" == "204" ]]; then
|
||||
echo "Work item $work_id cancelled."
|
||||
else
|
||||
echo "$body" | jq . || echo "$body"
|
||||
fi
|
||||
Reference in New Issue
Block a user