Fix Create

This commit is contained in:
R
2022-11-15 11:07:43 +07:00
parent 897a531326
commit f71eb71cfc
2 changed files with 8 additions and 7 deletions

View File

@@ -28,8 +28,8 @@ class PersonResource extends JsonResource
'phone' => $this->phone,
'email' => $this->email,
'blood_type' => $this->blood_type,
'weight' => (float) $this->last_weight_kg,
'height' => (float) $this->last_height_cm,
'weight' => !empty($this->last_weight_kg) ? (float) $this->last_weight_kg : null,
'height' => !empty($this->last_weight_kg) ? (float) $this->last_height_cm : null,
'relation_with_owner' => ($this->user && $this->user->person_id == $this->id) ? 'Self' : $this->pivot->relation_with_owner ?? null,
'marital_status' => $this->marital_status,
'last_education' => $this->last_education,