From 62b2b0fc99e9618b9217a16f5a474cb240947342 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Tue, 25 Feb 2025 10:49:07 -0500 Subject: [PATCH] Unwrap grid character object --- components/character/CharacterGrid/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/components/character/CharacterGrid/index.tsx b/components/character/CharacterGrid/index.tsx index 018b11ca..6616ca36 100644 --- a/components/character/CharacterGrid/index.tsx +++ b/components/character/CharacterGrid/index.tsx @@ -100,13 +100,19 @@ const CharacterGrid = (props: Props) => { if (!party.id) { props.createParty().then((team) => { saveCharacter(team.id, character, position) - .then((response) => storeGridCharacter(response.data)) + .then((response) => { + const data = response.data['grid_character'] + storeGridCharacter(data) + }) .catch((error) => console.error(error)) }) } else { if (props.editable) saveCharacter(party.id, character, position) - .then((response) => handleCharacterResponse(response.data)) + .then((response) => { + const data = response.data['grid_character'] + handleCharacterResponse(data) + }) .catch((error) => { const axiosError = error as AxiosError const response = axiosError.response @@ -126,6 +132,7 @@ const CharacterGrid = (props: Props) => { setPosition(data.position) setModalOpen(true) } else { + console.log(data) storeGridCharacter(data) } }