Update Province

Update Province

To edit the data in the specified collection with the specified parameters. When a JSON object is saved, the object properties are automatically added to the collection you specified.

Method : PUT

URL : /api/province

Body : JSON

{
	"id": 31,
	"name": "New Province Edit",
	"image_url": "https://images.unsplash.com/photo-1682687220063-4742bd7fd538?auto=format&fit=crop&q=60&w=500",
	"island_id": 1
}
id*Required
number

ID of province.

name*Required
string

Name of province.

image_url*Required
string

Province image URL

island_id
number

Province island ID

Response : 200 - OK

{
	"message": "Success update province"
}

Response : 422 - Unprocessable Content

{
    "error": [
        {
            "code": "too_small",
            "minimum": 1,
            "type": "string",
            "inclusive": true,
            "exact": false,
            "message": "Name is required",
            "path": [
                "name"
            ]
        },
        {
            "code": "too_small",
            "minimum": 1,
            "type": "string",
            "inclusive": true,
            "exact": false,
            "message": "Image URL is required",
            "path": [
                "image_url"
            ]
        }
    ]
}

Response : 404 - Not Found

Not Found

Response : 500 - Server Error

Internal Server Error