24
24
*
25
25
* @author Oliver Klee <[email protected] >
26
26
* @author Xheni Myrtaj <[email protected] >
27
+ * @author Tatevik Grigoryan <[email protected] >
27
28
*/
28
29
class ListController extends AbstractController
29
30
{
@@ -119,15 +120,15 @@ public function getLists(Request $request): JsonResponse
119
120
return new JsonResponse ($ json , Response::HTTP_OK , [], true );
120
121
}
121
122
122
- #[Route('/lists/{id } ' , name: 'get_list ' , methods: ['GET ' ])]
123
+ #[Route('/lists/{listId } ' , name: 'get_list ' , methods: ['GET ' ])]
123
124
#[OA \Get(
124
- path: '/lists/{list } ' ,
125
+ path: '/lists/{listId } ' ,
125
126
description: 'Returns a single subscriber list with specified ID. ' ,
126
127
summary: 'Gets a subscriber list. ' ,
127
128
tags: ['lists ' ],
128
129
parameters: [
129
130
new OA \Parameter (
130
- name: 'list ' ,
131
+ name: 'listId ' ,
131
132
description: 'List ID ' ,
132
133
in: 'path ' ,
133
134
required: true ,
@@ -189,8 +190,10 @@ public function getLists(Request $request): JsonResponse
189
190
)
190
191
]
191
192
)]
192
- public function getList (Request $ request , #[MapEntity(mapping: ['id ' => 'id ' ])] SubscriberList $ list ): JsonResponse
193
- {
193
+ public function getList (
194
+ Request $ request ,
195
+ #[MapEntity(mapping: ['listId ' => 'id ' ])] SubscriberList $ list
196
+ ): JsonResponse {
194
197
$ this ->requireAuthentication ($ request );
195
198
$ json = $ this ->serializer ->serialize ($ list , 'json ' , [
196
199
AbstractNormalizer::GROUPS => 'SubscriberList ' ,
@@ -199,9 +202,9 @@ public function getList(Request $request, #[MapEntity(mapping: ['id' => 'id'])]
199
202
return new JsonResponse ($ json , Response::HTTP_OK , [], true );
200
203
}
201
204
202
- #[Route('/lists/{id } ' , name: 'delete_list ' , methods: ['DELETE ' ])]
205
+ #[Route('/lists/{listId } ' , name: 'delete_list ' , methods: ['DELETE ' ])]
203
206
#[OA \Delete(
204
- path: '/lists/{list } ' ,
207
+ path: '/lists/{listId } ' ,
205
208
description: 'Deletes a single subscriber list. ' ,
206
209
summary: 'Deletes a list. ' ,
207
210
tags: ['lists ' ],
@@ -214,7 +217,7 @@ public function getList(Request $request, #[MapEntity(mapping: ['id' => 'id'])]
214
217
schema: new OA \Schema (type: 'string ' )
215
218
),
216
219
new OA \Parameter (
217
- name: 'list ' ,
220
+ name: 'listId ' ,
218
221
description: 'List ID ' ,
219
222
in: 'path ' ,
220
223
required: true ,
@@ -258,7 +261,7 @@ public function getList(Request $request, #[MapEntity(mapping: ['id' => 'id'])]
258
261
)]
259
262
public function deleteList (
260
263
Request $ request ,
261
- #[MapEntity(mapping: ['id ' => 'id ' ])] SubscriberList $ list
264
+ #[MapEntity(mapping: ['listId ' => 'id ' ])] SubscriberList $ list
262
265
): JsonResponse {
263
266
$ this ->requireAuthentication ($ request );
264
267
@@ -267,9 +270,9 @@ public function deleteList(
267
270
return new JsonResponse (null , Response::HTTP_NO_CONTENT , [], false );
268
271
}
269
272
270
- #[Route('/lists/{id }/subscribers ' , name: 'get_subscriber_from_list ' , methods: ['GET ' ])]
273
+ #[Route('/lists/{listId }/subscribers ' , name: 'get_subscriber_from_list ' , methods: ['GET ' ])]
271
274
#[OA \Get(
272
- path: '/lists/{id }/subscribers ' ,
275
+ path: '/lists/{listId }/subscribers ' ,
273
276
description: 'Returns a JSON list of all subscribers for a subscriber list. ' ,
274
277
summary: 'Gets a list of all subscribers of a subscriber list. ' ,
275
278
tags: ['lists ' ],
@@ -282,7 +285,7 @@ public function deleteList(
282
285
schema: new OA \Schema (type: 'string ' )
283
286
),
284
287
new OA \Parameter (
285
- name: 'id ' ,
288
+ name: 'listId ' ,
286
289
description: 'List ID ' ,
287
290
in: 'path ' ,
288
291
required: true ,
@@ -338,7 +341,7 @@ public function deleteList(
338
341
)]
339
342
public function getListMembers (
340
343
Request $ request ,
341
- #[MapEntity(mapping: ['id ' => 'id ' ])] SubscriberList $ list
344
+ #[MapEntity(mapping: ['listId ' => 'id ' ])] SubscriberList $ list
342
345
): JsonResponse {
343
346
$ this ->requireAuthentication ($ request );
344
347
@@ -351,9 +354,9 @@ public function getListMembers(
351
354
return new JsonResponse ($ json , Response::HTTP_OK , [], true );
352
355
}
353
356
354
- #[Route('/lists/{id }/subscribers/count ' , name: 'get_subscribers_count_from_list ' , methods: ['GET ' ])]
357
+ #[Route('/lists/{listId }/subscribers/count ' , name: 'get_subscribers_count_from_list ' , methods: ['GET ' ])]
355
358
#[OA \Get(
356
- path: '/lists/{id }/count ' ,
359
+ path: '/lists/{listId }/count ' ,
357
360
description: 'Returns a count of all subscribers in a given list. ' ,
358
361
summary: 'Gets the total number of subscribers of a list ' ,
359
362
tags: ['lists ' ],
@@ -366,7 +369,7 @@ public function getListMembers(
366
369
schema: new OA \Schema (type: 'string ' )
367
370
),
368
371
new OA \Parameter (
369
- name: 'id ' ,
372
+ name: 'listId ' ,
370
373
description: 'List ID ' ,
371
374
in: 'path ' ,
372
375
required: true ,
@@ -396,7 +399,7 @@ public function getListMembers(
396
399
)]
397
400
public function getSubscribersCount (
398
401
Request $ request ,
399
- #[MapEntity(mapping: ['id ' => 'id ' ])] SubscriberList $ list
402
+ #[MapEntity(mapping: ['listId ' => 'id ' ])] SubscriberList $ list
400
403
): JsonResponse {
401
404
$ this ->requireAuthentication ($ request );
402
405
$ json = $ this ->serializer ->serialize (count ($ list ->getSubscribers ()), 'json ' );
0 commit comments