Skip to content

Commit

Permalink
api pieces-hash keeps return map
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Jul 29, 2023
1 parent 925edf4 commit 3775f39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function register()
}

$this->renderable(function (AuthenticationException $e) {
return response()->json(fail($e->getMessage(), $e->guards()), 401);
return response()->json(fail($e->getMessage(), ['guards' => $e->guards()]), 401);
});

$this->renderable(function (UnauthorizedException $e) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/TorrentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function queryByPiecesHash(Request $request)
'pieces_hash' => 'required|array',
]);
$result = $this->repository->getPiecesHashCache($request->pieces_hash);
return $this->success($result);
return $this->success($result ?: (object)[]);
}

}

0 comments on commit 3775f39

Please sign in to comment.