Skip to content

Commit c7b4932

Browse files
.
Signed-off-by: matiasperrone-exo <matias.perrone@exomindset.co>
1 parent 5bae012 commit c7b4932

File tree

1 file changed

+51
-56
lines changed

1 file changed

+51
-56
lines changed

app/Http/Controllers/Api/OAuth2/OAuth2GroupApiController.php

Lines changed: 51 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -26,60 +26,7 @@
2626
*/
2727
final class OAuth2GroupApiController extends OAuth2ProtectedController
2828
{
29-
use GetAllTrait {
30-
GetAllTrait::getAll as traitGetAll;
31-
}
32-
33-
/**
34-
* OAuth2UserApiController constructor.
35-
* @param IGroupRepository $repository
36-
* @param IResourceServerContext $resource_server_context
37-
* @param ILogService $log_service
38-
*/
39-
public function __construct
40-
(
41-
IGroupRepository $repository,
42-
IResourceServerContext $resource_server_context,
43-
ILogService $log_service,
44-
)
45-
{
46-
parent::__construct($resource_server_context, $log_service);
47-
$this->repository = $repository;
48-
}
49-
50-
protected function getAllSerializerType(): string
51-
{
52-
return SerializerRegistry::SerializerType_Public;
53-
}
54-
55-
/**
56-
* @return array
57-
*/
58-
protected function getFilterRules(): array
59-
{
60-
return [
61-
'slug' => ['=='],
62-
];
63-
}
64-
65-
/**
66-
* @return array
67-
*/
68-
protected function getFilterValidatorRules(): array
69-
{
70-
return [
71-
'slug' => 'sometimes|required|string',
72-
];
73-
}
74-
75-
public function getOrderRules(): array
76-
{
77-
return [
78-
'id',
79-
'name',
80-
'slug'
81-
];
82-
}
29+
use GetAllTrait;
8330

8431
#[OA\Get(
8532
path: '/api/v1/groups',
@@ -166,8 +113,56 @@ public function getOrderRules(): array
166113
)
167114
]
168115
)]
169-
public function getAll()
116+
117+
/**
118+
* OAuth2UserApiController constructor.
119+
* @param IGroupRepository $repository
120+
* @param IResourceServerContext $resource_server_context
121+
* @param ILogService $log_service
122+
*/
123+
public function __construct
124+
(
125+
IGroupRepository $repository,
126+
IResourceServerContext $resource_server_context,
127+
ILogService $log_service,
128+
)
170129
{
171-
return $this->traitGetAll();
130+
parent::__construct($resource_server_context, $log_service);
131+
$this->repository = $repository;
172132
}
133+
134+
protected function getAllSerializerType(): string
135+
{
136+
return SerializerRegistry::SerializerType_Public;
137+
}
138+
139+
/**
140+
* @return array
141+
*/
142+
protected function getFilterRules(): array
143+
{
144+
return [
145+
'slug' => ['=='],
146+
];
147+
}
148+
149+
/**
150+
* @return array
151+
*/
152+
protected function getFilterValidatorRules(): array
153+
{
154+
return [
155+
'slug' => 'sometimes|required|string',
156+
];
157+
}
158+
159+
public function getOrderRules(): array
160+
{
161+
return [
162+
'id',
163+
'name',
164+
'slug'
165+
];
166+
}
167+
173168
}

0 commit comments

Comments
 (0)