approval change to single action

This commit is contained in:
xiaomlove
2022-06-15 15:43:33 +08:00
parent 4fbb279ed3
commit a8ca0ba831
14 changed files with 277 additions and 109 deletions
+19
View File
@@ -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);
}