diff --git a/app/Http/Controllers/Api/ProfileController.php b/app/Http/Controllers/Api/ProfileController.php index 4026cff..f59ebfe 100644 --- a/app/Http/Controllers/Api/ProfileController.php +++ b/app/Http/Controllers/Api/ProfileController.php @@ -71,7 +71,7 @@ public function update(Request $request, string $id): JSONResponse 'file_ktp' => ['nullable', 'file', 'mimes:jpg,jpeg,png,pdf', 'max:2048'], 'desa_kelurahan_id' => ['nullable', 'exists:master_desa_kelurahan,id'], ]); - + $profile = Profile::where('user_id', Auth::id())->first(); if ($request->hasFile('file_kk')) { diff --git a/routes/api.php b/routes/api.php index fa2da70..9e56a1d 100644 --- a/routes/api.php +++ b/routes/api.php @@ -19,7 +19,7 @@ Route::post('/logout', [\App\Http\Controllers\Api\AuthController::class, 'logout']); // Route::get('/profile', [\App\Http\Controllers\Api\ProfileController::class, 'show']); - // Route::put('/profile/{id}', [\App\Http\Controllers\Api\ProfileController::class, 'update']); + Route::put('/profile/{id}', [\App\Http\Controllers\Api\ProfileController::class, 'update']); Route::get('/profile/{id}/download/{type}', [\App\Http\Controllers\Api\ProfileController::class, 'downloadFile']); Route::apiResource('/profile', \App\Http\Controllers\Api\ProfileController::class)->only(['show', 'update']); });