mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 10:15:41 +00:00
fix: update watchlist calendar
This commit is contained in:
parent
7a46299dd4
commit
4e13fa1464
@ -64,7 +64,7 @@ export interface User {
|
|||||||
roles: string[]
|
roles: string[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Watchlist {
|
export interface Watchlist {
|
||||||
domains: string[],
|
domains: string[],
|
||||||
triggers: { event: EventAction, action: TriggerAction }[],
|
triggers: { event: EventAction, action: TriggerAction }[],
|
||||||
connector?: string
|
connector?: string
|
||||||
@ -76,8 +76,8 @@ export async function request<T = any, R = AxiosResponse<T>, D = any>(config: Ax
|
|||||||
baseURL: '/api',
|
baseURL: '/api',
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
headers: {
|
headers: {
|
||||||
|
Accept: 'application/ld+json',
|
||||||
...config.headers,
|
...config.headers,
|
||||||
Accept: 'application/ld+json'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return await axios.request<T, R, D>(axiosConfig)
|
return await axios.request<T, R, D>(axiosConfig)
|
||||||
|
|||||||
@ -25,7 +25,6 @@ use Sabre\VObject\Reader;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
|
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
use Symfony\Component\Serializer\SerializerInterface;
|
use Symfony\Component\Serializer\SerializerInterface;
|
||||||
|
|
||||||
@ -67,6 +66,7 @@ class WatchListController extends AbstractController
|
|||||||
* @throws ParseException
|
* @throws ParseException
|
||||||
* @throws EofException
|
* @throws EofException
|
||||||
* @throws InvalidDataException
|
* @throws InvalidDataException
|
||||||
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
#[Route(
|
#[Route(
|
||||||
path: '/api/watchlists/{token}/calendar',
|
path: '/api/watchlists/{token}/calendar',
|
||||||
@ -78,10 +78,8 @@ class WatchListController extends AbstractController
|
|||||||
)]
|
)]
|
||||||
public function getWatchlistCalendar(string $token): Response
|
public function getWatchlistCalendar(string $token): Response
|
||||||
{
|
{
|
||||||
|
/** @var WatchList $watchList */
|
||||||
$watchList = $this->watchListRepository->findOneBy(["token" => $token]);
|
$watchList = $this->watchListRepository->findOneBy(["token" => $token]);
|
||||||
/** @var User $user */
|
|
||||||
$user = $this->getUser();
|
|
||||||
if (!$user->getWatchLists()->contains($watchList)) throw new UnauthorizedHttpException('');
|
|
||||||
|
|
||||||
$calendar = new Calendar();
|
$calendar = new Calendar();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user