Added pattern matcher for backend name.

This commit is contained in:
abdulmohsen
2024-04-19 22:54:32 +03:00
parent aee685e88d
commit fe967a64b5
4 changed files with 9 additions and 3 deletions

View File

@@ -52,7 +52,7 @@ final class Index
return api_response(HTTP_STATUS::HTTP_OK, $response);
}
#[Get(self::URL . '/{id:[a-zA-Z0-9_-]+}[/]', name: 'backends.view')]
#[Get(self::URL . '/{id:backend}[/]', name: 'backends.view')]
public function backendsView(iRequest $request, array $args = []): iResponse
{
if (null === ($id = ag($args, 'id'))) {

View File

@@ -23,10 +23,10 @@ final class GenerateAccessToken
{
}
#[Post(self::URL . '/{backend:\w+}[/]', name: 'backends.plex.accesstoken')]
#[Post(self::URL . '/{id:backend}[/]', name: 'backends.plex.accesstoken')]
public function gAccesstoken(iRequest $request, array $args = []): iResponse
{
$backend = ag($args, 'backend');
$backend = ag($args, 'id');
$data = DataUtil::fromArray($request->getParsedBody());