chore: rename action creators to remove "AC"

This commit is contained in:
2024-08-17 19:24:45 +02:00
parent 0fab9d4e0a
commit 7b88633fba
11 changed files with 102 additions and 110 deletions

View File

@@ -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'))
}