From 10981a249681acc88ca481395f865e3002893ecb Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 23 Dec 2022 15:18:05 -0800 Subject: [PATCH] Remove headers from API calls --- components/CharacterGrid/index.tsx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/components/CharacterGrid/index.tsx b/components/CharacterGrid/index.tsx index b569bf41..9d631055 100644 --- a/components/CharacterGrid/index.tsx +++ b/components/CharacterGrid/index.tsx @@ -35,9 +35,6 @@ const CharacterGrid = (props: Props) => { const accountData: AccountCookie = cookie ? JSON.parse(cookie as string) : null - const headers = accountData - ? { headers: { Authorization: `Bearer ${accountData.token}` } } - : {} // Set up state for view management const { party, grid } = useSnapshot(appState) @@ -131,17 +128,14 @@ const CharacterGrid = (props: Props) => { character: Character, position: number ) { - return await api.endpoints.characters.create( - { - character: { - party_id: partyId, - character_id: character.id, - position: position, - uncap_level: characterUncapLevel(character), - }, + return await api.endpoints.characters.create({ + character: { + party_id: partyId, + character_id: character.id, + position: position, + uncap_level: characterUncapLevel(character), }, - headers - ) + }) } function storeGridCharacter(gridCharacter: GridCharacter) { @@ -155,7 +149,6 @@ const CharacterGrid = (props: Props) => { incoming: incoming.id, conflicting: conflicts.map((c) => c.id), position: position, - params: headers, }) .then((response) => { // Store new character in state @@ -187,7 +180,6 @@ const CharacterGrid = (props: Props) => { party: { job_id: job ? job.id : '', }, - ...headers, } if (party.id && appState.party.editable) { @@ -217,7 +209,6 @@ const CharacterGrid = (props: Props) => { const payload = { party: skillObject, - ...headers, } skillObject[positionedKey] = skill.id