Warm half the oil in a frying pan over a medium heat. Add the cod and gently cook on all sides for just a few minutes.
Warm the remaining oil in a second frying pan over a medium heat then add the carrots and onion and cook and stir until soft, about 4 to 6 minutes.
Transfer some of the fish into a casserole dish, top with cooked onion and carrots, then another layer of fish, and top with another layer of carrots. Brush each layer with mayonnaise as you go and top with tomatoes.
Bake in the preheated oven for 30 minutes until golden brown on top. Remove from the oven and serve.