Remove headers from API calls
This commit is contained in:
parent
c35fdf5f5c
commit
10981a2496
1 changed files with 7 additions and 16 deletions
|
|
@ -35,9 +35,6 @@ const CharacterGrid = (props: Props) => {
|
||||||
const accountData: AccountCookie = cookie
|
const accountData: AccountCookie = cookie
|
||||||
? JSON.parse(cookie as string)
|
? JSON.parse(cookie as string)
|
||||||
: null
|
: null
|
||||||
const headers = accountData
|
|
||||||
? { headers: { Authorization: `Bearer ${accountData.token}` } }
|
|
||||||
: {}
|
|
||||||
|
|
||||||
// Set up state for view management
|
// Set up state for view management
|
||||||
const { party, grid } = useSnapshot(appState)
|
const { party, grid } = useSnapshot(appState)
|
||||||
|
|
@ -131,17 +128,14 @@ const CharacterGrid = (props: Props) => {
|
||||||
character: Character,
|
character: Character,
|
||||||
position: number
|
position: number
|
||||||
) {
|
) {
|
||||||
return await api.endpoints.characters.create(
|
return await api.endpoints.characters.create({
|
||||||
{
|
character: {
|
||||||
character: {
|
party_id: partyId,
|
||||||
party_id: partyId,
|
character_id: character.id,
|
||||||
character_id: character.id,
|
position: position,
|
||||||
position: position,
|
uncap_level: characterUncapLevel(character),
|
||||||
uncap_level: characterUncapLevel(character),
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
headers
|
})
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function storeGridCharacter(gridCharacter: GridCharacter) {
|
function storeGridCharacter(gridCharacter: GridCharacter) {
|
||||||
|
|
@ -155,7 +149,6 @@ const CharacterGrid = (props: Props) => {
|
||||||
incoming: incoming.id,
|
incoming: incoming.id,
|
||||||
conflicting: conflicts.map((c) => c.id),
|
conflicting: conflicts.map((c) => c.id),
|
||||||
position: position,
|
position: position,
|
||||||
params: headers,
|
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
// Store new character in state
|
// Store new character in state
|
||||||
|
|
@ -187,7 +180,6 @@ const CharacterGrid = (props: Props) => {
|
||||||
party: {
|
party: {
|
||||||
job_id: job ? job.id : '',
|
job_id: job ? job.id : '',
|
||||||
},
|
},
|
||||||
...headers,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (party.id && appState.party.editable) {
|
if (party.id && appState.party.editable) {
|
||||||
|
|
@ -217,7 +209,6 @@ const CharacterGrid = (props: Props) => {
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
party: skillObject,
|
party: skillObject,
|
||||||
...headers,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
skillObject[positionedKey] = skill.id
|
skillObject[positionedKey] = skill.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue