Client - lint fix after prettier update
This commit is contained in:
parent
5b49928c84
commit
2fd2cd5c16
@ -45,12 +45,9 @@ export const updateUsersData = data => ({
|
|||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
|
||||||
export const getOrUpdateData = (
|
export const getOrUpdateData =
|
||||||
action,
|
(action, target, data, canDispatch = true) =>
|
||||||
target,
|
dispatch => {
|
||||||
data,
|
|
||||||
canDispatch = true
|
|
||||||
) => dispatch => {
|
|
||||||
dispatch(setLoading(true))
|
dispatch(setLoading(true))
|
||||||
if (data && data.id && target !== 'workouts' && isNaN(data.id)) {
|
if (data && data.id && target !== 'workouts' && isNaN(data.id)) {
|
||||||
dispatch(setLoading(false))
|
dispatch(setLoading(false))
|
||||||
@ -62,7 +59,9 @@ export const getOrUpdateData = (
|
|||||||
if (ret.status === 'success') {
|
if (ret.status === 'success') {
|
||||||
if (canDispatch) {
|
if (canDispatch) {
|
||||||
if (target === 'users' && action === 'getData') {
|
if (target === 'users' && action === 'getData') {
|
||||||
return dispatch(setPaginatedData(target, ret.data, ret.pagination))
|
return dispatch(
|
||||||
|
setPaginatedData(target, ret.data, ret.pagination)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
dispatch(setData(target, ret.data))
|
dispatch(setData(target, ret.data))
|
||||||
} else if (action === 'updateData' && target === 'sports') {
|
} else if (action === 'updateData' && target === 'sports') {
|
||||||
@ -79,7 +78,7 @@ export const getOrUpdateData = (
|
|||||||
dispatch(setLoading(false))
|
dispatch(setLoading(false))
|
||||||
dispatch(setError(`${target}|${error}`))
|
dispatch(setError(`${target}|${error}`))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const addData = (target, data) => dispatch =>
|
export const addData = (target, data) => dispatch =>
|
||||||
FitTrackeeApi.addData(target, data)
|
FitTrackeeApi.addData(target, data)
|
||||||
|
@ -154,7 +154,9 @@ export const deletePicture = () => dispatch =>
|
|||||||
throw error
|
throw error
|
||||||
})
|
})
|
||||||
|
|
||||||
export const deleteUser = (username, isAdmin = false) => dispatch =>
|
export const deleteUser =
|
||||||
|
(username, isAdmin = false) =>
|
||||||
|
dispatch =>
|
||||||
FitTrackeeGenericApi.deleteData('users', username)
|
FitTrackeeGenericApi.deleteData('users', username)
|
||||||
.then(ret => {
|
.then(ret => {
|
||||||
if (ret.status === 204) {
|
if (ret.status === 204) {
|
||||||
|
@ -57,15 +57,8 @@ class AdminUsers extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { authUser, location, message, t, pagination, updateUser, users } =
|
||||||
authUser,
|
this.props
|
||||||
location,
|
|
||||||
message,
|
|
||||||
t,
|
|
||||||
pagination,
|
|
||||||
updateUser,
|
|
||||||
users,
|
|
||||||
} = this.props
|
|
||||||
const translatedFilters = translateValues(t, userFilters)
|
const translatedFilters = translateValues(t, userFilters)
|
||||||
const translatedSortOrders = translateValues(t, sortOrders)
|
const translatedSortOrders = translateValues(t, sortOrders)
|
||||||
return (
|
return (
|
||||||
|
@ -26,15 +26,8 @@ class DashBoard extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { loadMoreWorkouts, message, records, sports, t, user, workouts } =
|
||||||
loadMoreWorkouts,
|
this.props
|
||||||
message,
|
|
||||||
records,
|
|
||||||
sports,
|
|
||||||
t,
|
|
||||||
user,
|
|
||||||
workouts,
|
|
||||||
} = this.props
|
|
||||||
const paginationEnd =
|
const paginationEnd =
|
||||||
workouts.length > 0
|
workouts.length > 0
|
||||||
? workouts[workouts.length - 1].previous_workout === null
|
? workouts[workouts.length - 1].previous_workout === null
|
||||||
|
@ -61,13 +61,8 @@ class ProfileEdit extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const { message, onDeleteUser, onHandleProfileFormSubmit, t, user } =
|
||||||
message,
|
this.props
|
||||||
onDeleteUser,
|
|
||||||
onHandleProfileFormSubmit,
|
|
||||||
t,
|
|
||||||
user,
|
|
||||||
} = this.props
|
|
||||||
const { displayModal, formData } = this.state
|
const { displayModal, formData } = this.state
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
@ -5,16 +5,8 @@ import { getDateWithTZ } from '../../../utils'
|
|||||||
import { formatWorkoutDate } from '../../../utils/workouts'
|
import { formatWorkoutDate } from '../../../utils/workouts'
|
||||||
|
|
||||||
export default function WorkoutCardHeader(props) {
|
export default function WorkoutCardHeader(props) {
|
||||||
const {
|
const { dataType, displayModal, segmentId, sport, t, title, user, workout } =
|
||||||
dataType,
|
props
|
||||||
displayModal,
|
|
||||||
segmentId,
|
|
||||||
sport,
|
|
||||||
t,
|
|
||||||
title,
|
|
||||||
user,
|
|
||||||
workout,
|
|
||||||
} = props
|
|
||||||
const workoutDate = workout
|
const workoutDate = workout
|
||||||
? formatWorkoutDate(getDateWithTZ(workout.workout_date, user.timezone))
|
? formatWorkoutDate(getDateWithTZ(workout.workout_date, user.timezone))
|
||||||
: null
|
: null
|
||||||
|
Loading…
Reference in New Issue
Block a user