Is this correct the way I answered this-I don't like onion cake so I'm telling them Sorry,but I don't like it.

¿Quieres comer pastel de cebollas conmigo?

Lo siento pero no, no me gusta pastel de cebollas.
Thank you

¡excelente! I wouldn't like it either!

Sra

Thank you

Yes, the way you answered the question is correct. You provided a polite response to the question "¿Quieres comer pastel de cebollas conmigo?" which means "Do you want to eat onion cake with me?" by saying "Lo siento pero no, no me gusta pastel de cebollas," which means "Sorry, but I don't like onion cake." You also concluded your response by saying "Thank you" which is a polite gesture. Well done!