mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
fix user history bugs
This commit is contained in:
parent
0618b92b24
commit
3c5e55277f
@ -467,6 +467,13 @@ class UserController extends Controller
|
||||
* @OA\Schema(type="string")
|
||||
* ),
|
||||
*
|
||||
* @OA\Parameter(
|
||||
* name="type",
|
||||
* in="path",
|
||||
* required=false,
|
||||
* @OA\Schema(type="string",enum={"anime", "manga"})
|
||||
* ),
|
||||
*
|
||||
* @OA\Response(
|
||||
* response="200",
|
||||
* description="Returns user history (past 30 days)",
|
||||
@ -482,7 +489,10 @@ class UserController extends Controller
|
||||
*/
|
||||
public function history(Request $request, string $username, ?string $type = null)
|
||||
{
|
||||
$type = strtolower($type);
|
||||
if (!is_null($type)) {
|
||||
$type = strtolower($type);
|
||||
}
|
||||
|
||||
if (!is_null($type) && !\in_array($type, ['anime', 'manga'])) {
|
||||
return HttpResponse::badRequest($request);
|
||||
}
|
||||
|
@ -2,4 +2,4 @@ Jikan\Model\User\History:
|
||||
exclusion_policy: NONE
|
||||
properties:
|
||||
malUrl:
|
||||
serialized_name: anime
|
||||
serialized_name: entry
|
Loading…
x
Reference in New Issue
Block a user