feat: Add endpoint to retrieve individual note from Anki
This commit is contained in:
parent
2353c1fd1a
commit
5586e80768
|
@ -7,14 +7,19 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
|
|
||||||
|
#[Route('/anki', name: 'app_anki_')]
|
||||||
class AnkiController extends AbstractController
|
class AnkiController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route('/anki', name: 'app_anki')]
|
function __construct(
|
||||||
public function index(AnkiService $ankiService): Response
|
private AnkiService $ankiService,
|
||||||
{
|
) {}
|
||||||
$note = $ankiService->getLatestNote();
|
|
||||||
|
|
||||||
$ankiService->updateNote($note);
|
#[Route('/', name: 'main')]
|
||||||
|
public function index(): Response
|
||||||
|
{
|
||||||
|
$note = $this->ankiService->getLatestNote();
|
||||||
|
|
||||||
|
$this->ankiService->updateNote($note);
|
||||||
|
|
||||||
dd($note);
|
dd($note);
|
||||||
dd($note->toAnki());
|
dd($note->toAnki());
|
||||||
|
@ -23,4 +28,10 @@ class AnkiController extends AbstractController
|
||||||
'controller_name' => $latestId,
|
'controller_name' => $latestId,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Route('/note/{nid}/get', name: 'get_note')]
|
||||||
|
public function get_note(int $nid)
|
||||||
|
{
|
||||||
|
dd($this->ankiService->getNote($nid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue