Atualiza os dados de uma planta

PUT /plants/{id}

Atualiza o nome, imagem ou localização de uma planta específica.

Path parameters

  • id integer Required

    ID da planta a ser atualizada.

application/json

Body Required

  • location_id integer

    ID da localização associada à planta.

  • name string

    Nome da planta.

  • image string

    URL da imagem da planta.

Responses

  • 200 application/json

    Planta atualizada com sucesso.

    Hide response attributes Show response attributes object
    • success boolean
    • message string
    • data object

      Additional properties are allowed.

      Hide data attributes Show data attributes object
      • id integer
      • users_id integer
      • plants_id integer
      • location_id integer
      • name string
      • image string
      • created_at string(date-time)
      • updated_at string(date-time)
  • 400 application/json

    Solicitação inválida.

    Hide response attribute Show response attribute object
    • message string
  • 404 application/json

    Planta não encontrada.

    Hide response attribute Show response attribute object
    • message string
PUT /plants/{id}
curl \
 --request PUT 'http://localhost:8000/plants/{id}' \
 --header "Content-Type: application/json" \
 --data '{"location_id":42,"name":"string","image":"string"}'
Request examples
{
  "location_id": 42,
  "name": "string",
  "image": "string"
}
Response examples (200)
{
  "success": true,
  "message": "Planta atualizada com sucesso.",
  "data": {
    "id": 42,
    "users_id": 42,
    "plants_id": 42,
    "location_id": 42,
    "name": "string",
    "image": "string",
    "created_at": "2025-05-04T09:42:00Z",
    "updated_at": "2025-05-04T09:42:00Z"
  }
}
Response examples (400)
{
  "message": "Dados inválidos fornecidos."
}
Response examples (404)
{
  "message": "Planta não encontrada."
}