Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 656 | Rev 2207 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 656 Rev 2194
Línea 1... Línea 1...
1
import { axios } from '../../utils'
1
import { axios } from '../../utils'
2
import { intlTypes } from './intl.types'
2
import { intlTypes } from './intl.types'
Línea 3... Línea 3...
3
 
3
 
4
export const getLanguage = () => {
4
export const getLanguage = () => {
5
  return async (dispatch) => {
-
 
6
    try {
5
  return async (dispatch) => {
7
      const response = await axios.get('/language')
6
    const response = await axios.get('/language')
Línea 8... Línea 7...
8
      const { data, success } = response.data
7
    const { data, success } = response.data
9
 
8
 
10
      if (!success) {
-
 
11
        return
-
 
12
      }
-
 
13
 
-
 
14
      dispatch(setIntlLabels(labelsAdapter(data)))
-
 
15
    } catch (error) {
9
    if (!success) {
-
 
10
      return
-
 
11
    }
16
      throw new Error(error)
12
 
17
    }
13
    dispatch(setIntlLabels(labelsAdapter(data)))
Línea 18... Línea 14...
18
  }
14
  }
19
}
15
}