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) => {
|
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) => {
|
export const setEditKey = (id: string) => {
|
||||||
if (!user) {
|
const edit_key = get<string>(id)
|
||||||
const edit_key = get<string>(id)
|
axios.defaults.headers.common['X-Edit-Key'] = edit_key
|
||||||
axios.defaults.headers.common['X-Edit-Key'] = edit_key
|
|
||||||
} else {
|
|
||||||
unsetEditKey()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const unsetEditKey = () => {
|
export const unsetEditKey = () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue