29 lines
709 B
PHP
29 lines
709 B
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Http\Controllers\Admin;
|
||
|
|
|
||
|
|
use App\Http\Controllers\Controller;
|
||
|
|
use App\Services\CopperConvertRequestService;
|
||
|
|
|
||
|
|
class CopperConvertRequestController extends Controller
|
||
|
|
{
|
||
|
|
public function index(CopperConvertRequestService $service)
|
||
|
|
{
|
||
|
|
return response()->json($service->listForAdmin());
|
||
|
|
}
|
||
|
|
|
||
|
|
public function approve(int $id, CopperConvertRequestService $service)
|
||
|
|
{
|
||
|
|
$row = $service->approve($id, (int) auth('user')->id());
|
||
|
|
|
||
|
|
return response()->json($row);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function reject(int $id, CopperConvertRequestService $service)
|
||
|
|
{
|
||
|
|
$row = $service->reject($id, (int) auth('user')->id());
|
||
|
|
|
||
|
|
return response()->json($row);
|
||
|
|
}
|
||
|
|
}
|