mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
approval change to single action
This commit is contained in:
@@ -74,3 +74,22 @@ function getOffer($params)
|
||||
return $offer->toArray();
|
||||
}
|
||||
|
||||
function approvalModal($params)
|
||||
{
|
||||
global $CURUSER;
|
||||
$rep = new \App\Repositories\TorrentRepository();
|
||||
return $rep->buildApprovalModal($CURUSER['id'], $params['torrent_id']);
|
||||
}
|
||||
|
||||
function approval($params)
|
||||
{
|
||||
global $CURUSER;
|
||||
foreach (['torrent_id', 'approval_status',] as $field) {
|
||||
if (!isset($params[$field])) {
|
||||
throw new \InvalidArgumentException("Require $field");
|
||||
}
|
||||
}
|
||||
$rep = new \App\Repositories\TorrentRepository();
|
||||
return $rep->approval($CURUSER['id'], $params);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user