It is exactly analagous to ask how much math you should learn given literally everyone has a scientific calculator in their pocket at all times.The answer is: to be a mathematician or an engineer, you still need to learn how to do the math yourself. A calculator makes the math easier and faster than doing integrals longhand, but owning a calculator does not mean you know how to apply an integral to a real problem.
You still must learn to write code yourself. You need to know the fundamentals of computer science, programming, algorithms. The AI is good, but it still requires human engineering effort to get good results in exactly the same way that a scientific calculator requires mathematic skill to be input in order to produce useful results.
Facing a tricky software engineering problem armed with AI and no fundamental knowledge puts you in exactly the same situation as facing a tricky vector problem armed with a calculator and no fundamental knowledge. You can punch keys and get numbers out. Maybe you'll even land on the right answer, but it will take you ten times longer, produce worse results, and you won't even know if your answer is right. You won't learn anything either.
Working a tricky problem is how you learn which solutions apply and how to best use your skills. AI is the same way. If you don't have the fundamental skills, you won't learn, you won't get good results, and you'll waste a ton of time producing garbage for no benefit.
AI is a skill multiplier, just like a calculator. It really, truly is a garbage in, garbage out situation. If you don't put in skill and effort, you don't get good results. If you lack the fundamental skill and engineering mindset you will never get good results, you'll never learn how to get better, and you likely won't even have the capacity to judge your work as the garbage it is.
The only exception is the case that AI truly reaches super-human levels of ability in the near future. That case isn't worth worrying about because the problems it will cause go far, far beyond "should I learn to code".
So yes, you should learn the fundamentals. AI makes good programmers better, and conversely makes bad programmers worse.