Hey Damir! Glad you liked it! I eventually haven’t clarified it good enough and have to rethink my phrasing there 😊! When to use map or flatMap is based on what you are going to return within a map function. And we want to return a redirect within that map function and since this is not a future we need use map here. 😊
I like to think of the map functions also in that way:
map is converting the value of Future<value> into whatever I return within the map function. Whereas the flatMap is converting the whole Future<value> into whatever I return within the map function 😊!
At the end not the inside of one of these map functions but the result of my mapping must match my return value of the route if I am returning that result. I hope that makes sense 😊?