From 52e6c7de1eb98f9506f4cf1bd330349779f966a8 Mon Sep 17 00:00:00 2001 From: Adrien Chevallereau <93998883+AdrienN7@users.noreply.github.com> Date: Mon, 30 May 2022 19:32:28 +0000 Subject: [PATCH] fix bug, bugs left --- .../java/moe/yuru/myserieslist/services/CharactersService.java | 2 +- frontend/components/media/MediaCard.tsx | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/moe/yuru/myserieslist/services/CharactersService.java b/backend/src/main/java/moe/yuru/myserieslist/services/CharactersService.java index a4f4728..c96bfa0 100644 --- a/backend/src/main/java/moe/yuru/myserieslist/services/CharactersService.java +++ b/backend/src/main/java/moe/yuru/myserieslist/services/CharactersService.java @@ -66,7 +66,7 @@ public Map characterOnMediaId(@PathParam("id") int id) { Map data = new HashMap<>(); ArrayList characters = new ArrayList<>(); characters.addAll(em.createQuery("FROM Chara WHERE Chara.charamedia_id ="+id, Chara.class).getResultList()); - data.put("person", characters); + data.put("chara", characters); return data; } diff --git a/frontend/components/media/MediaCard.tsx b/frontend/components/media/MediaCard.tsx index 33953a4..4617125 100644 --- a/frontend/components/media/MediaCard.tsx +++ b/frontend/components/media/MediaCard.tsx @@ -222,6 +222,7 @@ function AddActor({ const [acteur, setacteur] = useState(false); const [characts, setchar] = useState(null); + const getLinkPerso = useCallback( async (e) => { e.preventDefault(); @@ -231,6 +232,8 @@ function AddActor({ }); const data = await resp.json(); console.log(data); + setchar(data.chara) + }, [media.id] );