I couldn't stop my wife from having a late-night sweet craving

My spouse and I have been on a diet for weeks and we have started to lose weight. But since yesterday, they have been in a bad mood and suddenly at 11 PM, they insisted, “I’m going to eat something sweet.” I told them not to go, but they said, “I’m going to get it.” In the end, I let it go to avoid a fight, but it’s eating me inside… How does waking up at night to eat sweets affect the weight loss process? Was I too soft on them?