diff --git a/components/CharacterGrid/index.tsx b/components/CharacterGrid/index.tsx index 73cfcc08..f0b59039 100644 --- a/components/CharacterGrid/index.tsx +++ b/components/CharacterGrid/index.tsx @@ -267,17 +267,12 @@ const CharacterGrid = (props: Props) => { appState.party.id, payload ) - const team = response.data - + const team = response.data.party setJobAccessory(team.accessory) appState.party.accessory = team.accessory } } - useEffect(() => { - console.log(jobAccessory) - }, [jobAccessory]) - // Methods: Helpers function characterUncapLevel(character: Character) { let uncapLevel diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index 83e387c8..18c6f876 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -79,7 +79,7 @@ const JobSection = (props: Props) => { // Data fetching async function fetchJobAccessories() { - if (job && ACCESSORY_JOB_IDS.includes(job.id)) { + if (job && job.accessory) { const response = await api.jobAccessoriesForJob(job.id) const jobAccessories: JobAccessory[] = response.data setAccessories(jobAccessories) @@ -93,6 +93,7 @@ const JobSection = (props: Props) => { function handleAccessorySelected(value: string) { const accessory = accessories.find((accessory) => accessory.id === value) + if (accessory) { setCurrentAccessory(accessory) props.saveAccessory(accessory)