Update userToken.tsx
This commit is contained in:
parent
066a2238df
commit
8a3cda5c95
1 changed files with 6 additions and 8 deletions
|
|
@ -39,16 +39,14 @@ export const setHeaders = (
|
|||
}
|
||||
|
||||
export const storeEditKey = (id: string, key: string) => {
|
||||
ls(id, key)
|
||||
const stored = set(id, key)
|
||||
if (stored) setEditKey(id)
|
||||
return stored
|
||||
}
|
||||
|
||||
export const setEditKey = (id: string, user?: User) => {
|
||||
if (!user) {
|
||||
const edit_key = get<string>(id)
|
||||
axios.defaults.headers.common['X-Edit-Key'] = edit_key
|
||||
} else {
|
||||
unsetEditKey()
|
||||
}
|
||||
export const setEditKey = (id: string) => {
|
||||
const edit_key = get<string>(id)
|
||||
axios.defaults.headers.common['X-Edit-Key'] = edit_key
|
||||
}
|
||||
|
||||
export const unsetEditKey = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue