App\Http\Controllers\Api\V1\Profile\ProfileController::updateDiveCenter()api.v1.profile.dive-centerAuthorization: Bearer {token}PATCH/api/v1/profile/dive-centerapplication/json{ "dive_center_id": 1281 }| Field | Type | Required | Validation | Description |
|---|---|---|---|---|
dive_center_id | integer | Yes | required|integer|exists:dive_centers,id | Identifier from GET /api/v1/utility/dive-centers |
App\Http\Requests\Api\V1\Profile\UpdateDiveCenterRequest.dive_center_id here, while POST /api/v1/utility/dive-center takes the same identifier as id. The two endpoints are inconsistent.200 OK{
"success": true,
"status": "success",
"message": "Dive center updated successfully",
"data": { }
}data is the full user resource, reloaded. dive_center, dive_center_id and dive_center_date reflect the new assignment, and distributor may change with it.401 Unauthorized422 Unprocessable Entity — validation{
"success": false,
"status": "error",
"message": "Validation failed",
"errors": {
"dive_center_id": ["The selected dive center id is invalid."]
}
}422 Unprocessable Entity — professional renewal in progresserrors key.{
"success": false,
"status": "error",
"message": "Dive center cannot be changed while a professional renewal is active"
}404 Not FoundDiveCenterNewUser mailable is queued to the new centre through SendDiveCenterMail.200 means the job was dispatched, not that mail was delivered.docs/api/profile/PATCH_dive_center.mdcurl --location --request PATCH 'https://test.diveraid.com/api/v1/profile/dive-center' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"dive_center_id": 0
}'{
"status": "success",
"message": "string",
"data": {
"data": {
"raid_id": "string",
"exam_unlock_code": "string",
"email": "user@example.com",
"qrcode": "string",
"qualification": "string",
"cast": "string",
"category": "string",
"dive_center": "string",
"dive_center_id": 0,
"dive_center_date": "2019-08-24",
"distributor": "string",
"distributor_id": 0,
"distributor_date": "2019-08-24",
"first_name": "string",
"last_name": "string",
"full_name": "string",
"nationality": "string",
"country": "string",
"state": "string",
"state_code": "string",
"city": "string",
"address": "string",
"timezone": "string",
"postal_code": "string",
"phone": "string",
"mobile": "string",
"gender": "string",
"dob": "2019-08-24",
"nok_first_name": "string",
"nok_last_name": "string",
"nok_phone": "string",
"nok_email": "string",
"nok_country": "string",
"avatar": "string",
"e_card": "string",
"status": "string",
"suspension_days": 0,
"restore_date": "2019-08-24",
"restore_status": "string",
"status_reason": "string",
"professional_status": "string",
"professional_suspension_days": 0,
"professional_restore_date": "2019-08-24",
"professional_status_reason": "string",
"renewal_date": "2019-08-24",
"expire_date": "2019-08-24",
"guardian_first_name": "string",
"guardian_last_name": "string",
"guardian_email": "string",
"guardian_accepted": true,
"renew_causer": "string",
"renew_reason": "string",
"job_country": "string",
"default_language": "string",
"currency": "string",
"preferred_system": "string",
"vat_rate": 0,
"gdpr": "2019-08-24",
"terms": "2019-08-24",
"policy_accepted_at": "2019-08-24",
"email_verified_at": "2019-08-24",
"stripe_id": "string",
"created_at": "2019-08-24T14:15:22.123Z",
"updated_at": "2019-08-24T14:15:22.123Z"
},
"status": "success"
}
}