koel/app/Http/Controllers/API/Interaction/BatchLikeController.php

24 lines
650 B
PHP
Raw Normal View History

2017-08-06 09:43:59 +00:00
<?php
namespace App\Http\Controllers\API\Interaction;
use App\Http\Requests\API\BatchInteractionRequest;
2020-09-13 22:04:07 +00:00
use Illuminate\Http\Response;
2017-08-06 09:43:59 +00:00
class BatchLikeController extends Controller
{
2017-08-06 09:50:52 +00:00
public function store(BatchInteractionRequest $request)
2017-08-06 09:43:59 +00:00
{
2020-10-26 15:29:29 +00:00
$interactions = $this->interactionService->batchLike((array) $request->songs, $this->currentUser);
2018-08-18 12:27:26 +00:00
return response()->json($interactions);
2017-08-06 09:43:59 +00:00
}
public function destroy(BatchInteractionRequest $request)
{
2020-10-26 15:29:29 +00:00
$this->interactionService->batchUnlike((array) $request->songs, $this->currentUser);
2018-08-18 12:27:26 +00:00
2020-09-13 22:04:07 +00:00
return response()->json(null, Response::HTTP_NO_CONTENT);
2017-08-06 09:43:59 +00:00
}
}