changes in route method
This commit is contained in:
@@ -11,6 +11,8 @@ use Illuminate\Http\Request;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
|
||||
|
||||
class CustomerController extends Controller
|
||||
@@ -135,14 +137,18 @@ class CustomerController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function deleteCustomers($customerId)
|
||||
public function deleteCustomers(Request $request)
|
||||
{
|
||||
|
||||
try {
|
||||
if (!$customerId) {
|
||||
return jsonResponseWithErrorMessage('Customer ID is required', 400);
|
||||
}
|
||||
$validator = Validator::make($request->all(), [
|
||||
|
||||
'customer_id' => 'required|string',
|
||||
]);
|
||||
if ($validator->fails()) {
|
||||
return jsonResponseWithErrorMessage($validator->errors()->first(), 400);
|
||||
}
|
||||
$customerId = $request->input('customer_id');
|
||||
$response = $this->adminService->deleteCustomer(['customerId' => $customerId]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user