mirror of
https://github.com/koel/koel
synced 2024-12-12 21:52:28 +00:00
37 lines
973 B
PHP
37 lines
973 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Interaction;
|
|
|
|
use App\Http\Requests\API\BatchInteractionRequest;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class BatchLikeController extends Controller
|
|
{
|
|
/**
|
|
* Like several songs at once as the currently authenticated user.
|
|
*
|
|
* @param BatchInteractionRequest $request
|
|
*
|
|
* @return JsonResponse
|
|
*/
|
|
public function store(BatchInteractionRequest $request)
|
|
{
|
|
$interactions = $this->interactionService->batchLike((array) $request->songs, $request->user());
|
|
|
|
return response()->json($interactions);
|
|
}
|
|
|
|
/**
|
|
* Unlike several songs at once as the currently authenticated user.
|
|
*
|
|
* @param BatchInteractionRequest $request
|
|
*
|
|
* @return JsonResponse
|
|
*/
|
|
public function destroy(BatchInteractionRequest $request)
|
|
{
|
|
$this->interactionService->batchUnlike((array) $request->songs, $request->user());
|
|
|
|
return response()->json();
|
|
}
|
|
}
|