Pass through config link to redux

pull/10616/head
Jared Scheib 2017-12-12 15:10:54 -08:00
parent 74ffdab074
commit b2591828fe
2 changed files with 14 additions and 2 deletions

View File

@ -64,6 +64,7 @@ export const getMeAsync = ({shouldResetMe = false} = {}) => async dispatch => {
users,
organizations,
meLink,
config,
} = await getMeAJAX()
dispatch(
meGetCompleted({
@ -72,7 +73,9 @@ export const getMeAsync = ({shouldResetMe = false} = {}) => async dispatch => {
logoutLink,
})
)
dispatch(linksReceived({external, users, organizations, me: meLink})) // TODO: put this before meGetCompleted... though for some reason it doesn't fire the first time then
dispatch(
linksReceived({external, users, organizations, me: meLink, config})
) // TODO: put this before meGetCompleted... though for some reason it doesn't fire the first time then
} catch (error) {
dispatch(meGetFailed())
dispatch(errorThrown(error))

View File

@ -10,7 +10,15 @@ const addBasepath = (url, excludeBasepath) => {
}
const generateResponseWithLinks = (response, newLinks) => {
const {auth, logout, external, users, organizations, me: meLink} = newLinks
const {
auth,
logout,
external,
users,
organizations,
me: meLink,
config,
} = newLinks
return {
...response,
auth: {links: auth},
@ -19,6 +27,7 @@ const generateResponseWithLinks = (response, newLinks) => {
users,
organizations,
meLink,
config,
}
}