Cannot read 'type' of undefined: dispatch assignBugToUser

Hello, I’m going mad here but I seem to be missing something.

I keep getting this error:

Screenshot 2021-03-18 at 15.21.20

when dispatching assignBugToUser:

Screenshot 2021-03-18 at 15.23.00

Here is my action creator:

Screenshot 2021-03-18 at 15.24.07

And here is my reducer:

Screenshot 2021-03-18 at 15.24.58

I’ve tried comparing my code to Mosh’s code but cannot find where I’m going wrong?? Also what is the best approach to debug these type of errors?

Thanks in advance for the help!

I found the problem: it seems to be happening because I put the apiCallBegan function inside curly braces in the assignBugToUser function. Is it because I was passing an object instead of a function to the action creator?
Taking the curly braces out made it work.