fix: update watchlist calendar

This commit is contained in:
Maël Gangloff 2024-08-02 01:06:49 +02:00
parent 7a46299dd4
commit 4e13fa1464
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 4 additions and 6 deletions

View File

@ -76,8 +76,8 @@ export async function request<T = any, R = AxiosResponse<T>, D = any>(config: Ax
baseURL: '/api',
withCredentials: true,
headers: {
Accept: 'application/ld+json',
...config.headers,
Accept: 'application/ld+json'
}
}
return await axios.request<T, R, D>(axiosConfig)

View File

@ -25,7 +25,6 @@ use Sabre\VObject\Reader;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Serializer\SerializerInterface;
@ -67,6 +66,7 @@ class WatchListController extends AbstractController
* @throws ParseException
* @throws EofException
* @throws InvalidDataException
* @throws Exception
*/
#[Route(
path: '/api/watchlists/{token}/calendar',
@ -78,10 +78,8 @@ class WatchListController extends AbstractController
)]
public function getWatchlistCalendar(string $token): Response
{
/** @var WatchList $watchList */
$watchList = $this->watchListRepository->findOneBy(["token" => $token]);
/** @var User $user */
$user = $this->getUser();
if (!$user->getWatchLists()->contains($watchList)) throw new UnauthorizedHttpException('');
$calendar = new Calendar();