Skip to content

Commit ad64239

Browse files
author
kreaweb.be
committed
Improved Add persons/children/partners
1 parent cc21b5c commit ad64239

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

app/Livewire/People/Add/Child.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function saveChild()
153153

154154
if ($this->photos) {
155155
// if needed, create team photo folder
156-
$path = storage_path('app/public/photos/' . $this->new_person->team_id);
156+
$path = storage_path('app/public/photos/' . $new_person->team_id);
157157

158158
if (! File::isDirectory($path)) {
159159
File::makeDirectory($path, 0777, true, true);

app/Livewire/People/Add/Partner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function savePartner()
148148

149149
if ($this->photos) {
150150
// if needed, create team photo folder
151-
$path = storage_path('app/public/photos/' . $this->new_person->team_id);
151+
$path = storage_path('app/public/photos/' . $new_person->team_id);
152152

153153
if (! File::isDirectory($path)) {
154154
File::makeDirectory($path, 0777, true, true);

app/Livewire/People/Add/Person.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,12 @@ public function savePerson()
111111
'yob' => $validated['yob'],
112112
'dob' => $validated['dob'],
113113
'pob' => $validated['pob'],
114-
'father_id' => $this->person->id,
115-
'team_id' => $this->person->team_id,
114+
'team_id' => auth()->user()->currentTeam->id,
116115
]);
117116

118117
if ($this->photos) {
119118
// if needed, create team photo folder
120-
$path = storage_path('app/public/photos/' . $this->new_person->team_id);
119+
$path = storage_path('app/public/photos/' . $new_person->team_id);
121120

122121
if (! File::isDirectory($path)) {
123122
File::makeDirectory($path, 0777, true, true);

0 commit comments

Comments
 (0)