Cannot read properties of undefined (reading 'map')
map was called on a value the response never included. Default to an array before you iterate.
Solutions
The message, why it happens, and the corrected code. Three opening solutions.
map was called on a value the response never included. Default to an array before you iterate.