Skip to content

Commit

Permalink
Fix Delete Admin Companies
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtin590 committed Nov 8, 2024
1 parent 2ff5a5c commit da362fb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/Http/Controllers/Api/Admin/AdminCompaniesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,16 @@ public function markAsHot($companyId)
], 200);
}

public function destroy(Company $company)
{
$company->delete();
return response()->json([
'success' => true,
'message' => 'Company deleted successfully.',
'status_code' => 200
]);

}


}
3 changes: 2 additions & 1 deletion app/Http/Controllers/Api/Companies/JobsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,8 @@ private function getSuggestedJobs()
}

// Tìm kiếm các công việc dựa trên các tiêu chí trong objectives
$jobs = Job::query();
$jobs = Job::query()
->where('status', 1);

foreach ($objectives as $objective) {
// Lọc theo vị trí mong muốn
Expand Down
1 change: 1 addition & 0 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
Route::resource('/companies', AdminCompaniesController::class);
// Lấy danh sách công ty
Route::get('companies', [AdminCompaniesController::class, 'index']);
Route::delete('companies', [AdminCompaniesController::class, 'destroy']);

// Đánh dấu công ty là nổi bật
Route::post('companies/{companyId}/mark-as-hot', [AdminCompaniesController::class, 'markAsHot']);
Expand Down

0 comments on commit da362fb

Please sign in to comment.