Begin by putting the salted capers (if using) in a bowl, rinse them well to get rid of the salt.
Chop the onion and celery into small pieces.
Heat the olive oil in a frying pan or skillet. Add the onion, celery, olives and capers and cook until the onion becomes translucent.
Add the cherry tomatoes, cut in half. and when they start to soften add the passata and simmer for 15 minutes.
Cut the salt cod into medium sized pieces and add it to the sauce.
Add pepper to taste.
If you are going to use potatoes, peel them and cut them into pieces similar to the size of the fish. Add the potatoes to the sauce when you add the salt cod. Cover the pan, lower the heat and let everything cook together until the potatoes are cooked.
.If you are not using potatoes then just cover the sauce and simmer for about 15 minutes. If the sauce becomes to dry you can add a bit of water.
In the meantime cook the spaghetti al dente in boiling salted water according to the instructions on the packet. (don’t use a lot of salt because the fish and capers may still be salty)
Transfer half the baccalà and the potatoes to a dish and cover. You can serve this as a main course or the next day as a separate meal.
Drain the pasta and add it to the remaining sauce, mix together well. Sprinkle with chopped parsley and serve