| Total Complexity | 2 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class BatchLikeController extends Controller |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * Like multiple songs. |
||
| 14 | * |
||
| 15 | * Like several songs at once, useful for "batch" actions. An array of "interaction" records containing the song |
||
| 16 | * and user data will be returned. |
||
| 17 | * |
||
| 18 | * @bodyParam songs array required An array of song IDs. |
||
| 19 | * @responseFile responses/interactions.json |
||
| 20 | */ |
||
| 21 | 1 | public function store(BatchInteractionRequest $request) |
|
| 22 | { |
||
| 23 | 1 | $interactions = $this->interactionService->batchLike((array) $request->songs, $request->user()); |
|
| 24 | |||
| 25 | 1 | return response()->json($interactions); |
|
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Unlike multiple songs. |
||
| 30 | * |
||
| 31 | * Unlike several songs at once, useful for "batch" actions. An array of "interaction" records containing the song |
||
| 32 | * and user data will be returned. |
||
| 33 | * |
||
| 34 | * @bodyParam songs array required An array of song IDs. |
||
| 35 | * @responseFile responses/interactions.json |
||
| 36 | */ |
||
| 37 | 1 | public function destroy(BatchInteractionRequest $request) |
|
| 42 | } |
||
| 43 | } |
||
| 44 |