|
17 | 17 | use App\WikiProfile; |
18 | 18 | use App\WikiSetting; |
19 | 19 | use Illuminate\Http\Request; |
20 | | -use Illuminate\Support\Facades\App; |
21 | 20 | use Illuminate\Support\Facades\DB; |
22 | | -use Illuminate\Support\Facades\Validator; |
23 | 21 | use Illuminate\Support\Str; |
24 | 22 | use Illuminate\Support\Facades\Config; |
25 | 23 | use App\Helper\DomainValidator; |
@@ -63,14 +61,14 @@ public function create(Request $request): \Illuminate\Http\Response |
63 | 61 | 'username' => 'required', |
64 | 62 | 'profile' => 'nullable|json', |
65 | 63 | ]); |
66 | | - |
| 64 | + |
67 | 65 | $rawProfile = false; |
68 | 66 | if ($request->filled('profile') ) { |
69 | 67 | $rawProfile = json_decode($request->input('profile'), true); |
70 | 68 | $profileValidator = $this->profileValidator->validate($rawProfile); |
71 | 69 | $profileValidator->validateWithBag('post'); |
72 | 70 | } |
73 | | - |
| 71 | + |
74 | 72 | $wiki = null; |
75 | 73 | $dbAssignment = null; |
76 | 74 |
|
@@ -160,12 +158,12 @@ public function create(Request $request): \Illuminate\Http\Response |
160 | 158 | 'user_id' => $user->id, |
161 | 159 | 'wiki_id' => $wiki->id, |
162 | 160 | ]); |
163 | | - |
| 161 | + |
164 | 162 | // Create WikiProfile |
165 | 163 | if ($rawProfile) { |
166 | 164 | WikiProfile::create([ 'wiki_id' => $wiki->id, ...$rawProfile ] ); |
167 | 165 | } |
168 | | - |
| 166 | + |
169 | 167 |
|
170 | 168 | // TODO maybe always make these run in a certain order..? |
171 | 169 | dispatch(new MediawikiInit($wiki->domain, $request->input('username'), $user->email)); |
@@ -250,6 +248,7 @@ public function getWikiDetailsForIdForOwner(Request $request): \Illuminate\Http\ |
250 | 248 | $wiki = Wiki::where('id', $wikiId) |
251 | 249 | ->with('wikiManagers') |
252 | 250 | ->with('wikiDbVersion') |
| 251 | + ->with('wikiLatestProfile') |
253 | 252 | ->with('publicSettings')->first(); |
254 | 253 |
|
255 | 254 | $res = [ |
|
0 commit comments