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\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/anki', name: 'app_anki_')]
|
||||
class AnkiController extends AbstractController
|
||||
{
|
||||
#[Route('/anki', name: 'app_anki')]
|
||||
public function index(AnkiService $ankiService): Response
|
||||
{
|
||||
$note = $ankiService->getLatestNote();
|
||||
function __construct(
|
||||
private AnkiService $ankiService,
|
||||
) {}
|
||||
|
||||
$ankiService->updateNote($note);
|
||||
#[Route('/', name: 'main')]
|
||||
public function index(): Response
|
||||
{
|
||||
$note = $this->ankiService->getLatestNote();
|
||||
|
||||
$this->ankiService->updateNote($note);
|
||||
|
||||
dd($note);
|
||||
dd($note->toAnki());
|
||||
|
@ -23,4 +28,10 @@ class AnkiController extends AbstractController
|
|||
'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