@@ -391,7 +391,7 @@ import { userAPI } from './userAPI'
391
391
const updateUser = createAsyncThunk (
392
392
' users/update' ,
393
393
async (userData , { rejectWithValue }) => {
394
- const { id, ... fields } = userData ;
394
+ const { id, ... fields } = userData
395
395
try {
396
396
const response = await userAPI .updateById (id , fields )
397
397
return response .data .user
@@ -531,11 +531,16 @@ const usersSlice = createSlice({
531
531
})
532
532
533
533
const UsersComponent = () => {
534
- const { users, loading, error } = useSelector ((state : RootState ) => state .users )
534
+ const { users, loading, error } = useSelector (
535
+ (state : RootState ) => state .users
536
+ )
535
537
const dispatch: AppDispatch = useDispatch ()
536
538
537
539
// This is an example of an onSubmit handler using Formik meant to demonstrate accessing the payload of the rejected action
538
- const handleUpdateUser = async (values : FormValues , formikHelpers : FormikHelpers <FormValues >) => {
540
+ const handleUpdateUser = async (
541
+ values : FormValues ,
542
+ formikHelpers : FormikHelpers <FormValues >
543
+ ) => {
539
544
const resultAction = await dispatch (updateUser (values ))
540
545
if (updateUser .fulfilled .match (resultAction )) {
541
546
// user will have a type signature of User as we passed that as the Returned parameter in createAsyncThunk
0 commit comments