mirror of
https://github.com/ershisan99/it-incubator-todolist-ts-17-live-2024-08-17.git
synced 2026-02-04 21:02:13 +00:00
chore: rename action creators to remove "AC"
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { setAppErrorAC, setAppStatusAC } from 'app/app-reducer'
|
||||
import { setAppError, setAppStatus } from 'app/app-reducer'
|
||||
import { ResponseType } from 'api/todolists-api'
|
||||
import { Dispatch } from 'redux'
|
||||
|
||||
@@ -7,17 +7,17 @@ export const handleServerAppError = <D>(
|
||||
dispatch: Dispatch
|
||||
) => {
|
||||
if (data.messages.length) {
|
||||
dispatch(setAppErrorAC(data.messages[0]))
|
||||
dispatch(setAppError(data.messages[0]))
|
||||
} else {
|
||||
dispatch(setAppErrorAC('Some error occurred'))
|
||||
dispatch(setAppError('Some error occurred'))
|
||||
}
|
||||
dispatch(setAppStatusAC('failed'))
|
||||
dispatch(setAppStatus('failed'))
|
||||
}
|
||||
|
||||
export const handleServerNetworkError = (
|
||||
error: { message: string },
|
||||
dispatch: Dispatch
|
||||
) => {
|
||||
dispatch(setAppErrorAC(error.message ? error.message : 'Some error occurred'))
|
||||
dispatch(setAppStatusAC('failed'))
|
||||
dispatch(setAppError(error.message ? error.message : 'Some error occurred'))
|
||||
dispatch(setAppStatus('failed'))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user