HaciendaOps

Deleting tools

The HaciendaOps API allows users to delete existing tools, should something break during work or is no longer needed in the “toolbox.”

Prerequisites

Deleting a tool from the toolbox

  1. Start a local HaciendaOps instance.
    • To start the instance, run the following command:

      cd /HaciendaOps/api
      json-server -w hfg-db.json
      
  2. Open the Postman app on your computer.
  3. Locate the task you want to delete. For a full list of the tasks currently available in the to-do list, create a new request with the following values:
    • METHOD: GET
    • URL: /tool
    • Header: Content-Type: application/json
    • Return Body:

      
        {   
        "id": 1,
        "title": "Morning irrigation",
        "description": "Water the plants in Garden A",
        "task_type": "Watering",
        "due_date": "2024-06-05",
        "completed": false,
        "kaizen_notes": "Consider shifting to sunrise-only watering to reduce evaporation."
        },
        {
        "id": 2,
        "title": "Apply compost",
        "description": "Use organic compost in Zone B",
        "task_type": "Fertilizing",
        "due_date": "2024-06-06",
        "completed": false
        }
      
      
  4. After locating the tool to delete, create a new request with the following values:
    • METHOD: DELETE
    • URL: /tool/{toolTitle}
    • Header: Content-Type: application/json
    • Request Body: {}
  5. To confirm the tool is no longer in the “toolbox,” create a request with the following values:
    • METHOD: GET
    • URL: /tool/{previoustoolTitle}
    • Header: Content-Type: application/json
    • Request Body: {}
  6. Postman returns the following response if the deletion was successful: {} along with a “404 Not Found” error.

Result

You can now locate and delete old tools by name in HaciendaOps.