Unset edit key on page load
Just in case, we're unsetting the edit key on page load, so that we can re-set it after clearing our logic checks
This commit is contained in:
parent
37181d898b
commit
ade64446dc
2 changed files with 2 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import React, { useEffect, useState } from 'react'
|
||||
import { getCookie } from 'cookies-next'
|
||||
import { useRouter } from 'next/router'
|
||||
import { useSnapshot } from 'valtio'
|
||||
import clonedeep from 'lodash.clonedeep'
|
||||
|
|
@ -61,6 +62,7 @@ const Party = (props: Props) => {
|
|||
: null
|
||||
|
||||
let editable = false
|
||||
unsetEditKey()
|
||||
|
||||
if (props.new) editable = true
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ export const setHeaders = (
|
|||
export const setEditKey = (id: string, user?: User) => {
|
||||
if (!user) {
|
||||
const edit_key = get<string>(id)
|
||||
console.log('Setting header...', edit_key)
|
||||
axios.defaults.headers.common['X-Edit-Key'] = edit_key
|
||||
} else {
|
||||
unsetEditKey()
|
||||
|
|
|
|||
Loading…
Reference in a new issue