mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-13 23:12:16 +00:00
- Automatically append /api/v1 to base URL if not present - Fix URL construction to handle subpaths correctly - Update health check to parse new nested response format - Refactor bank delete command to use API client instead of direct requests - Remove redundant /api/v1 prefixes from endpoint calls 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
27 lines
747 B
Python
27 lines
747 B
Python
import click
|
|
|
|
from leggen.api_client import LeggenAPIClient
|
|
from leggen.main import cli
|
|
from leggen.utils.text import info, success
|
|
|
|
|
|
@cli.command()
|
|
@click.argument("requisition_id", type=str, required=True, metavar="REQUISITION_ID")
|
|
@click.pass_context
|
|
def delete(ctx, requisition_id: str):
|
|
"""
|
|
Delete bank connection
|
|
|
|
REQUISITION_ID: The ID of the Bank Requisition to delete
|
|
|
|
Check `leggen status` to get the REQUISITION_ID
|
|
"""
|
|
api_client = LeggenAPIClient(ctx.obj.get("api_url"))
|
|
|
|
info(f"Deleting Bank Requisition: {requisition_id}")
|
|
|
|
# Use API client to make the delete request
|
|
api_client._make_request("DELETE", f"/requisitions/{requisition_id}")
|
|
|
|
success(f"Bank Requisition {requisition_id} deleted")
|