The story had a happy ending, didn't/hadn't it?
I'm confused because Google returns both results:
But it had a happy ending, didn't it? Source.
That had been quite a happy ending, hadn't it? Source.
What's the correct option and why?
The story had a happy ending, didn't/hadn't it?
I'm confused because Google returns both results:
But it had a happy ending, didn't it? Source.
That had been quite a happy ending, hadn't it? Source.
What's the correct option and why?
The usual approach to forming the confirmation interrogative after a statement is to repeat the subject (possibly substituted with a pronoun) and use the auxiliary verb "do" or "be" in the same tense. Essentially you ask a short question (without all the substance) an answer to which would be the original statement.
We are having a great party, aren't we? (present continuous)
Children grew up quickly, didn't they? (past indefinite)
Mark has got a lot on his plate, hasn't he? (present perfect)
The story will be interesting, won't it? = (future indefinite)
There's been several attempts to explain it, hasn't there? (present perfect)
...and so on
Sometimes people use the "isn't it" confirmation to statements that involve people as subjects and actions as verbs, like
Victor just muddies the waters, isn't it?
but that is grammatically incorrect. The subject of the question part needs to represent the subject of the statement and the verb needs to represent the state or the action (or be the same modal or auxilirary):
Peter, John and Paul should study for the exams, shouldn't they?
Scientists must account for those factors, mustn't they?
Have you a light?
Has he any idea what's going to happen?
which suggests that after a statement with "have" as the main verb we could see a confirmation question start not with "do" but with "have" in the appropriate tense, but it's not idiomatic now.
With that in mind, your confirmation questions should be
The story had a happy ending, didn't it? ("had" = past indefinite, "it" = "story")