local docker config (dev) fixed
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import keyIndex from 'react-key-index'
|
||||
|
||||
import mpwoApi from '../mpwoApi'
|
||||
import { history } from '../index'
|
||||
import { generateIds } from '../utils'
|
||||
|
||||
|
||||
function AuthError(message) {
|
||||
return { type: 'AUTH_ERROR', message }
|
||||
@ -138,7 +138,7 @@ export function handleUserFormSubmit(event, formType) {
|
||||
if (ret.length === 0) {
|
||||
dispatch(register(formData.formData))
|
||||
} else {
|
||||
dispatch(AuthErrors(keyIndex(ret, 1)))
|
||||
dispatch(AuthErrors(generateIds(ret)))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
const apiUrl = `${process.env.REACT_APP_API_URL}`
|
||||
|
||||
|
||||
export default class MpwoApi {
|
||||
static login(email, password) {
|
||||
const request = new Request(`${apiUrl}auth/login`, {
|
||||
|
@ -1 +1,13 @@
|
||||
|
||||
|
||||
export const isLoggedIn = () => !!window.localStorage.authToken
|
||||
|
||||
export function generateIds(arr) {
|
||||
let i = 0
|
||||
let arrWithIds = arr.map(arr => {
|
||||
const obj = { id: i, value: arr }
|
||||
i++
|
||||
return obj
|
||||
})
|
||||
return arrWithIds
|
||||
}
|
||||
|
Reference in New Issue
Block a user