Refactor authorization methods in NovaSberPaymentOrderItemAuth to remove redundant user checks and update MakeSberPaymentAction to fix final_amount assignment.

This commit is contained in:
2025-09-09 10:33:02 +05:00
parent c54535e197
commit 640457b979
3 changed files with 39 additions and 19 deletions

View File

@@ -28,36 +28,18 @@ trait NovaSberPaymentOrderItemAuth
/** Edit button */
public function authorizedToUpdate(Request $request): bool
{
$user = auth()->user();
if ($user->isMe()) {
return true;
}
return false;
}
/** Update */
public function authorizeToUpdate(Request $request): void
{
$user = auth()->user();
if ($user->isMe()) {
return;
}
throw new AuthorizationException;
}
/** Delete button */
public function authorizedToDelete(Request $request)
{
$user = auth()->user();
if ($user->isMe()) {
return true;
}
return false;
}